AT_past202209_a 信号機
Description
There is a traffic light with a button.
In principle, if you press the button when the light is red, it turns green $ X $ seconds later.
However, if it would turn green earlier than $ Y $ seconds after it turned red last time, it turns green $ Y $ seconds after it turned red last time instead.
Now, the button has just been pressed $ Z $ seconds after it turned red last time.
How many seconds will pass before it turns green since it turned red last time?
Input Format
Input is given from Standard Input in the following format:
> $ X $ $ Y $ $ Z $
Output Format
Print the answer as an integer.
Explanation/Hint
### Sample Explanation 1
The elapsed time $ Z $ since it turned red plus $ X $ equals $ 5 + 10 = 15 $ seconds, which is less than $ Y = 20 $ seconds. So, as mentioned in the Problem Statement, it will turn green $ 20 $ seconds after it turned red.
### Constraints
- $ 1 \leq X,Y,Z \leq 100 $
- All values in input are integers.