a = sorted(list(map(int,input().split())))

d = 3*a[2] - sum(a)

if d%2 == 0:

    print((int(d/2)))

else:

    print((int((3*(a[2]+1) - sum(a))/2)))

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

no.sort()

a = no[0]

b = no[1] 

c = no[2]

cnt = 0

if a == b:

    print((int(c-a)))

elif a%2 != b%2 and a%2 == c%2:

    print((int(1+(c-b)+(b+1-a)/2)))

elif a%2 != b%2 and a%2 != c%2:

    print((int(1+(c-b)/2+(c+1-a)/2)))

elif a%2 == b%2 and b%2 == c%2:

    print((int((c-b)/2+(c-a)/2)))

elif a%2 == b%2 and b%2 != c%2:

    print((int(c-b+(c-(a+c-b))/2)))
a = sorted(list(map(int, input().split())))
d = 3 * a[2] - sum(a)
if d % 2 == 0:
    print((int(d / 2)))
else:
    print((int((3 * (a[2] + 1) - sum(a)) / 2)))

no = list(map(int, input().split()))
no.sort()
a = no[0]
b = no[1]
c = no[2]
cnt = 0
if a == b:
    print((int(c - a)))
elif a % 2 != b % 2 and a % 2 == c % 2:
    print((int(1 + (c - b) + (b + 1 - a) / 2)))
elif a % 2 != b % 2 and a % 2 != c % 2:
    print((int(1 + (c - b) / 2 + (c + 1 - a) / 2)))
elif a % 2 == b % 2 and b % 2 == c % 2:
    print((int((c - b) / 2 + (c - a) / 2)))
elif a % 2 == b % 2 and b % 2 != c % 2:
    print((int(c - b + (c - (a + c - b)) / 2)))

-a = sorted(list(map(int, input().split()))) -d = 3 * a[2] - sum(a) -if d % 2 == 0: -    print((int(d / 2))) -else: -    print((int((3 * (a[2] + 1) - sum(a)) / 2))) +no = list(map(int, input().split())) +no.sort() +a = no[0] +b = no[1] +c = no[2] +cnt = 0 +if a == b: +    print((int(c - a))) +elif a % 2 != b % 2 and a % 2 == c % 2: +    print((int(1 + (c - b) + (b + 1 - a) / 2))) +elif a % 2 != b % 2 and a % 2 != c % 2: +    print((int(1 + (c - b) / 2 + (c + 1 - a) / 2))) +elif a % 2 == b % 2 and b % 2 == c % 2: +    print((int((c - b) / 2 + (c - a) / 2))) +elif a % 2 == b % 2 and b % 2 != c % 2: +    print((int(c - b + (c - (a + c - b)) / 2)))