import collections

a,b,c = list(map(int,input().split()))

lists = [str(a%2),str(b%2),str(c%2)]

abc = [a,b,c]

an = []

if len(set(lists)) != 1:



    d = collections.Counter(lists)

    jud = int(d.most_common()[0][0])

    for i in range(3):

        if jud == int(lists[i]):

            an.append(i)

    for i in an:

            abc[i] += 1

    cnt = 1

else:

    cnt = 0



while 1:

    Max = max(abc)

    count = 0

    for i in range(3):

        if Max == abc[i]:

            count += 1

    if count == 1:

        cnt += 1

        for i in range(3):

            if Max != abc[i]:

                abc[i] += 1



    elif count == 2:

        cnt += abs(max(abc) - min(abc)) // 2

        abc.sort()

        abc[0] += abs(max(abc) - min(abc))

    elif count == 3:

        break



print(cnt)

abc = list(map(int,input().split()))

guki = [abc[0] % 2,abc[1] % 2,abc[2] % 2]

cnt_gusu = 0

cnt = 0

for i in abc:

    if i % 2 == 0:

        cnt_gusu += 1

if cnt_gusu == 2:

    cnt += 1

    for i in range(3):

        if abc[i] % 2 == 0:

            abc[i] += 1

elif cnt_gusu == 1:

    cnt += 1

    for i in range(3):

        if abc[i] % 2 == 1:

            abc[i] += 1

set_abc = set(abc)

abc.sort()

if len(set_abc) == 1:

    print(cnt)

elif len(set_abc) == 2:

    maxv = max(abc)

    jud = 0

    for i in abc:

        if i == maxv:

            jud += 1

    if jud == 2:

        cnt += (abc[2] - abc[0]) // 2

    else:

        cnt += (abc[2] - abc[0])

    print(cnt)

else:

    zouka = abc[2] - abc[1]

    cnt += zouka + ((abc[2] - (abc[0]+zouka) ) // 2)

    print(cnt)
import collections

a, b, c = list(map(int, input().split()))
lists = [str(a % 2), str(b % 2), str(c % 2)]
abc = [a, b, c]
an = []
if len(set(lists)) != 1:
    d = collections.Counter(lists)
    jud = int(d.most_common()[0][0])
    for i in range(3):
        if jud == int(lists[i]):
            an.append(i)
    for i in an:
        abc[i] += 1
    cnt = 1
else:
    cnt = 0
while 1:
    Max = max(abc)
    count = 0
    for i in range(3):
        if Max == abc[i]:
            count += 1
    if count == 1:
        cnt += 1
        for i in range(3):
            if Max != abc[i]:
                abc[i] += 1
    elif count == 2:
        cnt += abs(max(abc) - min(abc)) // 2
        abc.sort()
        abc[0] += abs(max(abc) - min(abc))
    elif count == 3:
        break
print(cnt)

abc = list(map(int, input().split()))
guki = [abc[0] % 2, abc[1] % 2, abc[2] % 2]
cnt_gusu = 0
cnt = 0
for i in abc:
    if i % 2 == 0:
        cnt_gusu += 1
if cnt_gusu == 2:
    cnt += 1
    for i in range(3):
        if abc[i] % 2 == 0:
            abc[i] += 1
elif cnt_gusu == 1:
    cnt += 1
    for i in range(3):
        if abc[i] % 2 == 1:
            abc[i] += 1
set_abc = set(abc)
abc.sort()
if len(set_abc) == 1:
    print(cnt)
elif len(set_abc) == 2:
    maxv = max(abc)
    jud = 0
    for i in abc:
        if i == maxv:
            jud += 1
    if jud == 2:
        cnt += (abc[2] - abc[0]) // 2
    else:
        cnt += abc[2] - abc[0]
    print(cnt)
else:
    zouka = abc[2] - abc[1]
    cnt += zouka + ((abc[2] - (abc[0] + zouka)) // 2)
    print(cnt)

-import collections - -a, b, c = list(map(int, input().split())) -lists = [str(a % 2), str(b % 2), str(c % 2)] -abc = [a, b, c] -an = [] -if len(set(lists)) != 1: -    d = collections.Counter(lists) -    jud = int(d.most_common()[0][0]) +abc = list(map(int, input().split())) +guki = [abc[0] % 2, abc[1] % 2, abc[2] % 2] +cnt_gusu = 0 +cnt = 0 +for i in abc: +    if i % 2 == 0: +        cnt_gusu += 1 +if cnt_gusu == 2: +    cnt += 1 -        if jud == int(lists[i]): -            an.append(i) -    for i in an: -        abc[i] += 1 -    cnt = 1 +        if abc[i] % 2 == 0: +            abc[i] += 1 +elif cnt_gusu == 1: +    cnt += 1 +    for i in range(3): +        if abc[i] % 2 == 1: +            abc[i] += 1 +set_abc = set(abc) +abc.sort() +if len(set_abc) == 1: +    print(cnt) +elif len(set_abc) == 2: +    maxv = max(abc) +    jud = 0 +    for i in abc: +        if i == maxv: +            jud += 1 +    if jud == 2: +        cnt += (abc[2] - abc[0]) // 2 +    else: +        cnt += abc[2] - abc[0] +    print(cnt) -    cnt = 0 -while 1: -    Max = max(abc) -    count = 0 -    for i in range(3): -        if Max == abc[i]: -            count += 1 -    if count == 1: -        cnt += 1 -        for i in range(3): -            if Max != abc[i]: -                abc[i] += 1 -    elif count == 2: -        cnt += abs(max(abc) - min(abc)) // 2 -        abc.sort() -        abc[0] += abs(max(abc) - min(abc)) -    elif count == 3: -        break -print(cnt) +    zouka = abc[2] - abc[1] +    cnt += zouka + ((abc[2] - (abc[0] + zouka)) // 2) +    print(cnt)