Going on a road trip has been an adventure for Dr. Orooji and the programming team. Obviously he has to stop to refuel the car, but he also stops whenever the team members want to eat. Dr. O needs to figure out the number of stops before going on the trip so he is mentally prepared.
The Problem: Find the total number of stops for Dr. O’s trip, given:
1. Total miles to be traveled.
2. How often he stops for gas (in miles).
3. How often he stops for food (in miles). Assume that the car’s gas tank is full at the beginning of the trip and the team members are full as well. If the destination happens to be the time to refuel (or eat), do not count it as a stop. Also, if a particular mileage happens to be both refueling time and eating time, count it as one stop and not two stops. Note that if a particular mileage happens to be refueling time only, the team members won’t eat at that stop. Similarly, if a particular mileage happens to be eating time only, the car is not refueled at that stop.
There is one input line, it provides three integers (each between 1 and 1000, inclusive); these are the three values specified in order above.
Print the number of stops for the trip on a line by itself.