It's not the number of gears(speeds) which are important here but their their ratios.
San Francisco has lots of steep hills. There are also lots of flat areas. So if you live in a flat area or you won't use the bike on the steep hills then it doesn't really matter a 3 or 5 speed will be fine.
If you plan to ride over the hills then you will need lower gear ratios. This means you would probably need a bike with much lower gearing, such as a mountain bike. When on vacation in SF last year I used a 24 speed mountain bike and used the very lowest gear on the steepest hills.
If you tell the bike shop your needs then they will be able to advise you. I have given a link to a an advisory. Page 27 has advice about gearing.