John works as a part-time employee at a bookstore. His regular pay rate is $12 per hour for the first 40 hours each week. For any hours worked beyond 40 hours in a week, he is paid 1.5 times his regular pay rate. Last week, John earned a total of $660. How many hours did he work in total last week? Let's think step by step and output the final answer within \boxed{}.
user