During the Winter Sale, a shop is offering a promotion where for every 3 hours of shopping, you get an additional 1 hour free. If Sam shopped for a total of 12 hours, how many hours did he actually spend in the shop? Let's think step by step and output the final answer within \boxed{}.
user