King's Inspection

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

The Far Far Away Kingdom treasury is in trouble --- the King is coming with an inspection. It is known that the King likes order. So the chief treasurer needs to put the three chests that store the Kingdom gold coins in order. He looked into the chests and found out that they contain aa, bb and cc coins, respectively. But the King would definitely like the chests to contain the same number of coins each.

To make the number of coins equal, the chief treasurer started to put additional coins to them with both hands. Each second he chooses two distinct chests and adds one more coin to each one of them.

Help the chief treasurer find out how many seconds he needs to make the number of coins in the chests equal.

입력

Input contains three lines.

The first line contains an integer aa.

The second line contains an integer bb.

The third line contains an integer cc (1a,b,c51081 \le a, b, c \le 5\cdot 10^8).

출력

Output one integer --- the minimum number of seconds that the chief treasurer needs to make the number of coins in the chests equal.

힌트

One optimal strategy for the first test is the following: first, add a coin to chests 11 and 33, then add a coin to chests 11 and 22, and again to chests 11 and 22.

All chests in the second test already contain equal number of coins.