CF1064A.Make a triangle!

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Make a triangle!

Masha has three sticks of length aa, bb and cc centimeters respectively. In one minute Masha can pick one arbitrary stick and increase its length by one centimeter. She is not allowed to break sticks.

What is the minimum number of minutes she needs to spend increasing the stick's length in order to be able to assemble a triangle of positive area. Sticks should be used as triangle's sides (one stick for one side) and their endpoints should be located at triangle's vertices.

Input

The only line contains tree integers aa, bb and cc (1a,b,c1001 \leq a, b, c \leq 100) — the lengths of sticks Masha possesses.

Output

Print a single integer — the minimum number of minutes that Masha needs to spend in order to be able to make the triangle of positive area from her sticks.

Note

In the first example, Masha can make a triangle from the sticks without increasing the length of any of them.

In the second example, Masha can't make a triangle of positive area from the sticks she has at the beginning, but she can spend one minute to increase the length 22 centimeter stick by one and after that form a triangle with sides 33, 33 and 55 centimeters.

In the third example, Masha can take 3333 minutes to increase one of the 1010 centimeters sticks by 3333 centimeters, and after that take 4848 minutes to increase another 1010 centimeters stick by 4848 centimeters. This way she can form a triangle with lengths 4343, 5858 and 100100 centimeters in 8181 minutes. One can show that it is impossible to get a valid triangle faster.

Samples

3 4 5
0
2 5 3
1
100 10 10
81

在线编程 IDE

建议全屏模式获得最佳体验