#arc123a. [arc123_a]Arithmetic Sequence

[arc123_a]Arithmetic Sequence

Problem Statement

Given is a sequence of three integers A=(A1,A2,A3)A = (A_1, A_2, A_3). On this sequence, you can do the following operation any number of times:

  • choose iin1,2,3i\\in \\{1,2,3\\} and add 11 to AiA_i.

Find the minimum number of operations needed to make AA arithmetic. Here, the sequence A=(A1,A2,A3)A = (A_1, A_2, A_3) is arithmetic when A2A1=A3A2A_2 - A_1 = A_3 - A_2 holds.

Constraints

  • 1leqA1,A2,A3leq10151\\leq A_1, A_2, A_3\\leq 10^{15}

Input

Input is given from Standard Input in the following format:

A1A_1 A2A_2 A3A_3

Output

Print the answer.


Sample Input 1

4 8 10

Sample Output 1

2

One operation with i=1i = 1 and then one operation with i=3i = 3 yield an arithmetic sequence (5,8,11)(5, 8, 11).


Sample Input 2

10 3 4

Sample Output 2

4

Four operations with i=2i = 2 yield an arithmetic sequence (10,7,4)(10, 7, 4).


Sample Input 3

1 2 3

Sample Output 3

0

The sequence AA is already arithmetic from the beginning, so we need zero operations.


Sample Input 4

1000000000000000 1 1000000000000000

Sample Output 4

999999999999999