Hide

Problem A
Á leið í bíó

Languages en is
/problems/aleidibio/file/statement/en/img-0001.jpg
Photo from flickr.com

Hannes and Arnar are going to the cinema. They have already ordered their tickets online and they just ate, so they are not stopping in the lobby for snacks and drinks. Therefore, they will be able to enter the screening room in no time. Hannes is still a bit unsure about when he should get going. Hannes is at his house currently. Before Hannes goes to the cinema he must pick up Arnar. It will take him $a$ minutes to drive to Arnar. Then he needs to drive from Arnar’s location to the cinema which will take him $b$ minutes. If the film is scheduled to start on minute $c$ of the day, on what minute of the day should Hannes start driving, at the latest, so they do not miss the advertisements?

Input

The input consists of three lines. The first line consists of a single integer $a$, the number of minutes it takes to drive from Hannes to Arnar. The second line consists of a single integer $b$, the number of minutes it takes to drive from Arnar to the cinema. The third line consists of a single integer $c$, the minute of the day, on which the film is scheduled to start.

Output

Output a single integer, the latest possible minute of the day, on which Hannes can start driving without them being late.

Scoring

Group

Points

Constraints

1

100

$1 \leq a, b \leq 100$, and $720 \leq c \leq 1\, 439$

Sample Input 1 Sample Output 1
10
4
1335
1321
Sample Input 2 Sample Output 2
8
10
1000
982

Please log in to submit a solution to this problem

Log in