Jamie drives from her home to her workplace, a distance of 45 miles. She drives at a speed of 60 miles per hour for the first half of the distance and then slows down to 30 miles per hour for the second half. On her way back home, she drives the entire distance at a constant speed of 40 miles per hour. How much time, in total, does Jamie spend driving to work and back home? Let's think step by step and output the final answer within \boxed{}.
user