Alex receives a weekly bonus based on his performance at work. If he works more than 40 hours a week, he gets a bonus of $100 for every hour worked over 40. Otherwise, he receives a flat bonus of $50 for the week. Last week, Alex worked 45 hours. How much bonus does Alex receive? Let's think step by step and output the final answer within \boxed{}.
user