Joey wants to buy a gym membership. He visits two gyms with two different fees. Gym A has a $40 sign up fee and it costs $25 per month. Gym B has a $50 sign up fee and costs $20 per month. How many months will he have to belong at each before the costs are the same?

40 + 25 m = 50 + 20 m

5 m = 10
m = 2