Advance tickets: represented by x
Same-day tickets: represented by y
you can model this using a system of equations
x + y = 65
40x + 30y = 2200
then you have to get either the x or y value equivalent in both equations
40(x + y = 65)
40x + 40y = 2600
so the new equations are 40x + 40y = 2600 and 40x + 30y = 2200
then you can solve by using elimination
40x + 40y = 2600
-(40x + 30y = 2200)
10y = 400
y = 40
substitute y back into the first equation
x + 40 = 65
x = 25