Which trips ended in San Francisco?
select t1.id from trip as t1 join station as t2 on t1.end_station_id = t2.id where t2.city = "San Francisco"
Which did not?
select t1.id from trip as t1 join station as t2 on t1.end_station_id = t2.id where t2.city != "San Francisco"
Count them.
select count(*) from trip as t1 join station as t2 on t1.end_station_id = t2.id where t2.city != "San Francisco"