In a local gym, there are two types of membership plans available: a monthly membership for $40 and an annual membership that costs $400. If a person chooses the annual membership, they effectively get two months free compared to purchasing the monthly membership for 12 months. If a new member decides to pay for their membership using the monthly plan for the first 5 months and then switches to the annual plan for the rest of the year, how much total money will they spend in one year?