1214_B. Badges_28857
There are b boys and g girls participating in Olympiad of Metropolises. There will be a board games tournament in the evening and n participants have accepted the invitation. The organizers do not know how many boys and girls are among them.

Organizers are preparing red badges for girls and blue ones for boys.

Vasya prepared n+1 decks of badges. The i-th (where i is from 0 to n, inclusive) deck contains i blue badges and n-i red ones. The total number of badges in any deck is exactly n.

Determine the minimum number of decks among these n+1 that Vasya should take, so that there will be a suitable deck no matter how many girls and boys there will be among the participants of the tournament.

Input

The first line contains an integer b (1 ≤ b ≤ 300), the number of boys. 

The second line contains an integer g (1 ≤ g ≤ 300), the number of girls. 

The third line contains an integer n (1 ≤ n ≤ b + g), the number of the board games tournament participants.

Output

Output the only integer, the minimum number of badge decks that Vasya could take.

Examples

Input


5
6
3


Output


4


Input


5
3
5


Output


4

Note

In the first example, each of 4 decks should be taken: (0 blue, 3 red), (1 blue, 2 red), (2 blue, 1 red), (3 blue, 0 red).

In the second example, 4 decks should be taken: (2 blue, 3 red), (3 blue, 2 red), (4 blue, 1 red), (5 blue, 0 red). Piles (0 blue, 5 red) and (1 blue, 4 red) can not be used.
b = int(raw_input())
g = int(raw_input())
n = int(raw_input())

ans = 0
for i in xrange(0, b+1):
	if (n >=i and n-i <=g):
		ans+=1

print ans

5
3
5
 5
6
3
 4
7
10
 100
200
250
 4
2
5
 300
300
600
 5
5
9
 300
299
300
 123
55
100
 1
1
2
 4
4
7
 5
299
4
 100
200
300
 100
200
150
 3
4
5
 299
259
300
 300
300
1
 123
222
250
 2
2
3
 7
8
10
 199
199
199
 199
131
45
 10
10
12
 1
1
1
 50
100
120
 288
188
300
 2
56
57
 4
3
5
 3
3
4
 297
297
298
 3
3
5
 1
200
33
 5
6
10
 300
1
45
 4
4
5
 300
299
198
 5
557
4
 100
200
57
 3
4
2
 299
259
406
 300
448
1
 123
222
56
 199
199
221
 199
131
22
 10
20
12
 297
162
298
 5
10
10
 4
4
3
 5
3
8
 300
299
179
 100
24
57
 299
259
391
 123
222
92
 199
89
221
 199
131
41
 297
96
298
 299
263
391
 199
167
221
 199
131
61
 297
78
298
 300
88
179
 100
15
68
 299
263
192
 123
222
23
 199
167
279
 199
131
47
 300
74
164
 199
84
192
 199
187
14
 300
107
164
 2
2
2
 1
2
1
 2
90
57
 3
3
1
 300
1
73
 5
2
3
 5
557
5
 3
4
4
 300
333
1
 2
0
2
 10
19
12
 1
0
1
 2
90
3
 3
3
2
 300
1
128
 5
2
2
 300
307
179
 5
557
7
 100
24
68
 3
1
1
 300
333
2
 123
222
67
 2
0
1
 10
2
12
 2
107
3
 3
1
2
 300
1
150
 5
3
2
 5
557
2
 300
333
3
 10
2
8
 2
10
3
 297
6
298
 3
2
2
 300
0
150
 5
3
1
 300
88
164
 5
982
2
 100
3
68
 299
236
192
 300
279
3
 123
443
23
 199
84
279
 199
187
47
 10
2
3
 2
8
3
 297
1
298
 3
2
4
 300
0
177
 5
3
4
 5
1576
2
 100
3
19
 299
448
192
 300
23
3
 123
158
23
 10
2
2
 2
8
1
 300
1
177
 5
4
4
 5
1576
3

4
 4
 2
 51
 2
 1
 2
 300
 56
 1
 2
 5
 1
 101
 3
 259
 2
 96
 2
 6
 200
 46
 9
 2
 31
 177
 2
 3
 3
 297
 2
 2
 2
 2
 4
 199
 5
 58
 3
 153
 2
 57
 178
 23
 11
 162
 6
 4
 1
 180
 25
 168
 93
 68
 42
 96
 172
 146
 62
 78
 89
 16
 193
 24
 88
 48
 75
 85
 15
 108
 3
 2
 3
 2
 2
 3
 6
 4
 2
 1
 11
 1
 3
 3
 2
 3
 180
 6
 25
 2
 3
 68
 1
 1
 3
 2
 2
 3
 3
 4
 3
 3
 6
 3
 1
 2
 89
 3
 4
 193
 4
 24
 5
 48
 3
 3
 1
 2
 1
 4
 3
 4
 193
 4
 24
 3
 2
 2
 5
 4
