Inventory for moderately priced starter homes is tight, and it’s driving up home prices, making homes less affordable for America’s middle class.

A recent study by Realtor.com sought to pinpoint where homes were the least affordable, analyzing the monthly median cost of housing in 500 metros.

The study divided the median monthly cost of housing for both renters and homeowners by the median monthly income, limiting its ranking to just one metro per state. Here are the cities it highlighted as having the least affordable housing:

1. Santa Cruz, California

Median list price: $895,800

Median monthly housing cost: $1,840

Median household income: $73,663

Share of income going toward housing: 30%

2. Miami, Florida

Median list price: $385,100

Median monthly housing cost: $1,280

Median household income: $51,758

Share of income going toward housing: 29.7%

3. Grants Pass, Oregon

Median list price: $334,600

Median monthly housing cost: $918

Median household income: $40,705

Share of income going toward housing: 27.1%

4. Atlantic City, New Jersey

Median list price: $240,000

Median monthly housing cost: $1,290

Median household income: $57,514

Share of income going toward housing: 26.9%

5. New York, New York

Median list price: $515,100

Median monthly housing cost: $1,588

Median household income: $72,205

Share of income going toward housing: 26.4%

6. Kahului, Hawaii

Median list price: $928,800

Median monthly housing cost: $1,594

Median household income: $72,743

Share of income going toward housing: 26.3%

7. Jacksonville, North Carolina

Median list price: $203,300

Median monthly housing cost: $1,028

Median household income: $48,162

Share of income going toward housing: 25.6%

8. Bellingham, Washington

Median list price: $415,000

Median monthly housing cost: $1,203

Median household income: $56,419

Share of income going toward housing: 25.6%

9. Barnstable Town, Massachusetts

Median list price: $525,00

Median monthly housing cost: $1,411

Median household income: $68,048

Share of income going toward housing: 24.9%

10. Carson City, Nevada

Median list price: $347,100

Median monthly housing cost: $1,012

Median household income: $49,341

Share of income going toward housing: 24.6%