Yes, San Francisco is unaffordable, but 3rd least is an exaggeration:
-This does not include the entire world, just cities in English-speaking (+Japan for some reason) developed countries with metro areas exceeding 1M people.
-By most measures (http://www.theatlantic.com/business/archive/2013/07/china-ha...), Shanghai, Shenzhen, and Beijing have worse housing affordability than the English-speaking #1 of Hong Kong.
-This is using the SF-Oakland MSA (http://en.wikipedia.org/wiki/San_Francisco%E2%80%93Oakland%E...), which is far broader than San Francisco itself.
-Comparing different MSAs is not exactly apples and apples. The New York MSA extends to Pike County, 80 miles from Manhattan. Under this definition, you could start including lower-cost Sacramento and Stockton with San Francisco.