Sam drives from City A to City B at a constant speed of 60 miles per hour. He spends $15 on gas for the trip. If gas costs $3 per gallon and his car's fuel efficiency is 30 miles per gallon, how many hours did it take him to drive from City A to City B? Let's think step by step and output the final answer within \boxed{}.
user