Well, there must be also a given number of "middle class" people, that are not top notch programmers, nor "entry level" or "retail".
If we take these as valid data:
https://www.bls.gov/regions/west/news-release/occupationalem...
And set an arbitrary threshold at 45 US$/hour, the amount of people exceeding that are 31.1%, if we set it at 50 US$/hour they are 19.4%.
If we draw another line, those that get less than 25 US$/hour are 42.1% and those that get more than 25 but less than 45 are 26.6%.
So, even if we assume that 40% of people commutes for long distances (and BTW technically are not SF residents), since only between 20% and 30% of San Francisco workers can actually afford it, it still leaves us with 30%-40% of people that must be in a really tight spot.