A bus in Springfield has a maximum capacity of 40 passengers. The bus begins its route with $N$. At the first stop, no one gets on the bus and 4 people get off the bus, at which point the total number of people is divisible by 7. At the second stop, no one gets off the bus and 2 people get on the bus, at which point the total number of people is divisible by 5. Find $N$.

Source: ARML Local 2020

Happy problem solving!

Email your solutions to [email protected]