WalletHub’s latest rankings show which U.S. cities have the healthiest housing markets. Out of 300 cities ranked, San Francisco came in the top 30 at No. 29 overall.

In determining these overall rankings, WalletHub judged each city by its real-estate market along with its affordability and economic environment. In terms of real estate, San Francisco placed high at No. 23 overall, but the other category was another story. WalletHub ranked San Francisco at No. 156 in terms of affordability and economic environment.