Tea Party


Parsa has invited everyone from the MAPS Beginner Competition to a tea party. He has exactly three teapots, each with infinite capacity. The first teapot contains aa litres of tea, the second one contains bb litres, and the third one contains cc litres, where aa, bb, and cc are non-negative integers.

Parsa believes in equality, so he wants all the teapots to have the exact same amount of tea. In one step, he can pour any real (i.e. fractional allowed) amount of tea from one teapot to another.

Help him determine the minimum number of steps required to make all three teapots contain the same amount of tea.

Input

The only line of input contains three integers a,b,ca, b, c which is the initial amount of tea in each of the teapots.

Output

Print the minimum number of steps to make all the teapots have equal amount of tea.

Constraints

  • 0a,b,c10120 \le a, b, c \le 10^{12}

Example 1

Input 1
4 5 4
Output 1
2

Example 2

Input 2
1 3 2
Output 2
1

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.