When the college rankings site Niche released its Best Places To Live Rankings for 2017, Ann Arbor, Michigan took the number one spot for best cities, with the likes of Naperville, Illinois taking the silver medal.

But not very far down the list in the number five spot: none other than Berkeley, California.

Niche compares American cities via measures like public school performance (according to the standardized testing scores and graduation rates), crime rates (according to the FBI Uniform Crime Report), cost of living (Consumer Price Index), housing (median home values and rent, property taxes), and jobs (employment rate, job growth).

Despite all of this data, the rankings are a bit subjective. Of all of the measures, Niche (a colleges site, remember) weights the higher education rate—the number of residents in a city owning at least a Bachelor’s Degree—as the most important factor out of the 14.

And the opinions of local citizens come into it as a well: Niche collects Yelp-style reviews about each city. Out of 52 reviews this year, 49 Berkeley residents gave the city either four or five stars out of five.

But even if the standards are a bit singular, it’s a banner showing for the People’s Republic, especially considering that San Francisco only came in 24th on the same list.

Both cities got identical scores in most categories, but Berkeley barely edged out SF for public schools (A+ to our A-), crime and safety (C+ to our C-), housing (C+ and C- again), and family services (A+/A-).

The only category where San Francisco took the lead: jobs, netting a B+ against Berkeley’s B grade. The worst category for both cities: cost of living, a D+ on both fronts. San Francisco’s 262 reviews yielded 231 scores of four or five stars.

Among other surprises in the Niche numbers: 20 out of the 50 suburban cities dubbed the safest (again, based on FBI data about crimes per capita) were in the Bay Area. The safest of all of them: Hillsborough.

As the San Francisco Chronicle points out, it’s also one of the priciest places to live, and yes, that’s not a coincidence.