Home prices continue to soar in most of the country — but there are places where they remain cheap.

In the second quarter of this year, single-family home prices rose in 161 out of 178 metropolitan areas, according to the latest quarterly data from the National Association of Realtors (NAR).

The national median price for existing single-family homes reached a new peak of $269,000 last quarter — 5.3 percent higher than it was one year prior. Rising mortgage rates also are putting more pressure on people hoping to buy a home.

Despite the challenges homebuyers in many cities face, homes remain downright affordable in some pockets of the nation.

Buying a home in the nation’s cheapest markets

In the metropolitan areas that currently have the most affordable housing markets, buyers can afford a home with an income of as little as $19,000, the NAR says. In many other areas, buyers can afford a home with a modest income of $30,000 or $40,000.

The following metropolitan areas were the most affordable in the second quarter of this year, based on qualifying income, according to NAR. To qualify to buy a home, a buyer who puts down 20 percent would need the following incomes.

All income figures assume a 4.7 percent mortgage interest rate and a monthly principal and interest payment that is limited to 25 percent of income:

Youngstown-Warren-Boardman, Ohio-Pennsylvania: $18,984

Cumberland, Maryland-West Virginia: $19,084

Decatur, Illinois: $19,487

Elmira, New York: $21,377

Erie, Pennsylvania: $24,474

Binghamton, New York: $24,715

Wichita Falls, Texas: $25,500

Toledo, Ohio: $25,862

Rockford, Illinois: $25,902

Peoria, Illinois: $26,022

Waterloo-Cedar Falls, Iowa: $26,183

Davenport-Moline-Rock Island, Iowa-Illinois: $26,203

South Bend-Mishawaka, Indiana-Michigan: $26,726

Fond du Lac, Wisconsin: $27,068

Florence, South Carolina: $27,370

Canton-Massillon, Ohio: $27,511

Springfield, Illinois: $27,792

To put all of this in perspective, the national median income for families was $75,106 in the second quarter of this year, according to the NAR’s analysis of U.S. Census data.

Also, even if you could not make a 20 percent down payment, you wouldn’t need that much higher of an income to qualify to buy a home in these markets. For example, in the No. 1-ranked Youngstown area, you would need an income of $21,357 with a 10 percent down payment or $22,543 with a 5 percent down payment.

Meanwhile, in the most expensive metro area — San Jose, California, and surrounding areas — you would need an income of $282,546 with 20 percent down to $335,524 with 5 percent down to qualify to buy a home.

Tips for buying a home

Looking at the list above, one region is conspicuously absent: the West. That’s not a surprise, as prices are soaring in that region of the country. In fact, the 10 markets where prices are growing fastest are all located in the West.