A mortgage is taken out for 80,000$. It is to be paid by annual installments of 5000$ with the first payment being made at the end of the first year that the mortgage was taken out. Interest of 4% is then charged on any outstanding debt. Find the total time taken to pay off the mortgage.

The answer given is 25 years.

Can someone please help me with this problem?