Julia spend $40 / 2 = $<<40/2=20>>20 on the game.
After buying the game, she has $40 - $20 = $<<40-20=20>>20 left.
She spent $20 / 4 = $<<20/4=5>>5 on in-game purchases.
She has $20 - $5 = $<<20-5=15>>15 left.
#### 15