you can work backwards here, starting with the $9:
since he spent 25% of the "remaining money" and had $9 left, that means the $9 is the other 75%. since 25% is one-third of 75%, that 25% was also one-third of $9, which is $3, so add $9 and $3 to get $12. therefore, "remaining money" = $12
before this he'd spent 25% of the "original money," and had $12 of "remaining money," which makes $12 the other 75%. again 25 is one third of 75, so you would determine one third of $12, which is $4; add those together to get $16 total.
please let me know if that makes sense lol and hope it helps