Los Angeles may now be the country’s least affordable housing market, but that doesn’t prevent it from being a desirable place to retire. 

According to a recent Bankrate study, LA comes in at No. 3 overall in terms of where to retire in the United States. To score each city, Bankrate looked at a variety of factors, including tax burdens, crime rates, living costs, weather, public transportation, cultural amenities, elderly population, and well-being of seniors.

Though cost-of-living and taxes were high, and there were questions raised about healthcare and well-being of seniors, LA scored very well in most categories examined. Los Angeles had more things to do than any other city ranking among the top 50, and (along with San Diego) had the best weather. Despite frequent criticisms about public transportation in the Southland, nearly every city but New York was seen to have less-than-ideal access there as well. 

Pittsburgh and Boston were the only cities ahead of Los Angeles on the list, with Denver and Providence coming in right behind to round out the top five. LA wasn’t the only California city to make the list, either. San Diego came in at No. 23, and San Francisco was 27th. Sacramento followed right after at 28th, and Riverside rounded out the top 50 cities to retire in.