It's tough enough to buy a home. Saving the cash for a down payment takes a ton of financial discipline—not to mention the psychological gumption you need to muster to commit to 30 years of monthly payments.

But woe unto ye who live in these 10 metro areas, where the barriers to homeownership are unusually high. Blame skyrocketing home prices and, well, non-skyrocketing incomes—these are the least affordable cities in America.

"These markets are very expensive by any measure, and they're forecasted to get worse," said Jonathan Smoke, chief economist of realtor.com. "That’s why consumers looking for affordable options need to act as soon as they can."

How did we figure this out? Simple division.

After combing through columns and columns of data on income, home prices, and assorted other variables, we identified what we defined as "bad ZIP codes." A bad ZIP code is one where more than half of all households can't afford the median-price home in the area (i.e., they don't make enough money to even qualify for a loan).

Once we identified the bad ZIPs in a metro area, we simply divided that number by the number of total ZIPs in a metro area. The Miami metro area, for example, encompasses 185 ZIP codes, and in 80 of them—roughly 43%—more than half the households can't afford a median-price home. That put it at No. 10 on our list.

What are the metro areas for Nos. 9 through 1? Read on to find out (and to see examples of median-price homes).

———

10. Miami, FL

18101 SW 139th Path, Miami, $250,000

Minimum annual income required to get a loan: $61,240

2014 median income: $44,967

Total ZIP codes in metro: 185

ZIP codes where more than half of households can't afford a median-price home: 80

———

9. Seattle, WA

4102 N Bennett St, Tacoma, WA, $339,950

Minimum annual income required to get a loan: $74,587

2014 median income: $66,130

Total ZIP codes in metro: 161

ZIP codes where more than half of households can't afford a median-price home: 76

———

8. Sacramento, CA

2619 R St, Sacramento, $330,000

Minimum annual income required to get a loan: $71,604

2014 median income: $56,332

Total ZIP codes in metro: 118

ZIP codes where more than half of households can't afford a median-price home: 57

———

7. Portland, OR

7360 SW Mallard Ct, Portland, $315,000

mallard ct

Minimum annual income required to get a loan: $67,531

2014 median income: $55,113

Total ZIP codes in metro: 118

ZIP codes where more than half of households can't afford a median-price home: 59

———

6. Boston, MA

30 Van Brunt St, Boston, $379,000

Minimum annual income required to get a loan: $90,781

2014 median income: $71,190

Total ZIP codes in metro: 278

ZIP codes where more than half of households can't afford a median-price home: 159

———

5. New York City, NY

470 Convent Ave Apt 63, New York City, $365,000

Minimum annual income required to get a loan: $90,132

2014 median income: $64,538

Total ZIP codes in metro: 912

ZIP codes where more than half of households can't afford a median-price home: 759

———

4. San Jose, CA

368 Fuller Ave, San Jose, $620,000

Minimum annual income required to get a loan: $130,989

2014 median income: $87,582

Total ZIP codes in metro: 63

ZIP codes where more than half of households can't afford a median-price home: 58

———

3. San Francisco, CA

1409 17th St, Oakland, CA, $610,000

Minimum annual income required to get a loan: $134,518

2014 median income: $73,821

Total ZIP codes in metro: 170

ZIP codes where more than half of households can't afford a median-price home: 157

———

2. Los Angeles, CA

154th St

Minimum annual income required to get a loan: $110,405

2014 median income: $57,580

Total ZIP codes in metro: 378

ZIP codes where more than half of households can't afford a median-price home: 351

———

1. San Diego, CA

1658 Irwin St, Chula Vista, CA, $405,000

Minimum annual income required to get a loan: $89,440

2014 median income: $59,846

Total ZIP codes in metro: 106

ZIP codes where more than half of households can't afford a median-price home: 99