|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||512 MB||12||7||5||50.000%|
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 $a$, $b$ and $c$ 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 $a$.
The second line contains an integer $b$.
The third line contains an integer $c$ ($1 \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.
1 2 3
2 2 2
One optimal strategy for the first test is the following: first, add a coin to chests $1$ and $3$, then add a coin to chests $1$ and $2$, and again to chests $1$ and $2$.
All chests in the second test already contain equal number of coins.