A factory produces widgets at a rate of 50 widgets per hour. During a 5-hour shift, the factory runs at full capacity. However, for the next 3-hour shift, it operates at half capacity. Calculate the total number of widgets produced in the 8-hour period. Let's think step by step and output the final answer within \boxed{}.
user