Orange County teachers can afford only 7.06 percent of homes on the market, making it the third toughest place for them to buy a residence in the U.S., a study by real estate website Trulia shows.

San Francisco and San Jose present even more of a challenge, with just 0.4 percent and 2 percent, respectively, of homes there for sale within a teacher’s reach.

Teachers are not alone in the struggle to find places to live while working in pricey parts of the country. Police officers, firefighters, and restaurant workers in Orange County also are finding that homes they can buy on their wages are scarce.

“With home prices on the rise across the county and inventory at historic lows, homeownership is even more out of reach for many middle-income Americans,” says Trulia senior economist Cheryl Young.

In Orange County, the slice of homes for sale that are affordable to first responders is just 11.16 percent.

Restaurant workers faced the greatest hurdle, with the lowest reported wages among the occupations that Trulia studied. At gross earnings of just over $20,000 a year, Los Angeles area restaurant workers can afford only 0.32 percent of homes on the market today.

In Orange County, just 0.13 percent of homes for sale are affordable to a restaurant worker.

Trulia used median salaries to compute its findings. In Orange County, they are $24,418 for restaurant workers, $80,390 for teachers and $89,815 for first responders, according to the Bureau of Labor Statistics recently-released May 2016 Occupational Employment Statistics report.

The analysts defined affordability as having a debt-to-income ratio of 31 percent, meaning the monthly housing payment would take up only 31 percent of the paycheck. They assumed borrowers would put down a 20 percent down payment for a 30-year fixed rate mortgage at a 4.1 percent interest rate.

Also part of the affordability calculation: Any homeowners association fees, property taxes and insurance.

The analysts looked at median listing prices, which they pegged at $799,999 in Orange County, as opposed to the recent median sale price of $645,000 for the county in February, according to CoreLogic, a real estate data firm based in Irvine.

“We used the median listing price as opposed to sold, as we wanted to quantify the percentage of homes currently on the market,” said Katie Gallagher of Trulia.

Nationally, the typical worker grosses $37,040 annually while the typical house costs $254,900, Trulia says. That means that a worker with a median income would have to spend 42 percent of their income on mortgage payments if they bought a median-priced home, up six percentage points from 2015.

You can see more of the study here