Mr. Smith is planning to make an additional investment at the end of each year for his retirement in 20 years. Mr. Smith plans to invest $5,000 each year for the first 5 years, $8,000 each year for the next 5 years, and $ 12,000 each year for the remaining 10 years. If the rate of return of 9 percent can be earned in these investments, how much money will Mr. Smith have at the end of 20 years?