Mr. Smith has saved $1,200 each year for 25 years. A year after the saving period ended, Mr. Smith withdrew $4,500 each year for a period of 5 years. In the sixth and seventh years, he only withdrew $3,000 per year. In the eighth year, he decided to withdraw the remaining money in his account. If the interest rate was 5% per year throughout the whole period, what was the amount he withdrew at the end of the eighth year?