Ryan is tracking how much money he has each week.

He started with $60. He spent $5 per week until he had $20 left in the account.

After spending $5 per week, Ryan has $55 in week 1, $50 in week 2, $45 in week 3, $40 in week 4, $35 in week 5, $30 in week 6, and $25 in week 7.

In week 8, after spending another $5, he only has $20 left in the account.

Therefore, Ryan spent a total of $40 ($5 per week for 8 weeks) and now has $20 left.