A system is not needed to solve this problem. The tickets cost $23.50; subtract that from 40 to find the total they spent on snacks.