from sys import stdin

import math



li = list(map(int,stdin.readline().rstrip().split()))



li.sort(reverse = True)



point = 0

su = sum(li)%2

sai = li[0]%2



if sum(li) == 1:

    print((1))

    exit()



else:

    if su != sai:

        li[0] += 1

        point += 1

    point += (li[0]*2-li[1]-li[2])//2



print(point)
li = list(map(int,input().split()))

li.sort()



lin = li[:]



if sum(li)%2 != 3*li[2]%2:

    lin[2] += 1



print(((lin[2]*3-sum(li))//2))
from sys import stdin
import math

li = list(map(int, stdin.readline().rstrip().split()))
li.sort(reverse=True)
point = 0
su = sum(li) % 2
sai = li[0] % 2
if sum(li) == 1:
    print((1))
    exit()
else:
    if su != sai:
        li[0] += 1
        point += 1
    point += (li[0] * 2 - li[1] - li[2]) // 2
print(point)

li = list(map(int, input().split()))
li.sort()
lin = li[:]
if sum(li) % 2 != 3 * li[2] % 2:
    lin[2] += 1
print(((lin[2] * 3 - sum(li)) // 2))

-from sys import stdin -import math - -li = list(map(int, stdin.readline().rstrip().split())) -li.sort(reverse=True) -point = 0 -su = sum(li) % 2 -sai = li[0] % 2 -if sum(li) == 1: -    print((1)) -    exit() -else: -    if su != sai: -        li[0] += 1 -        point += 1 -    point += (li[0] * 2 - li[1] - li[2]) // 2 -print(point) +li = list(map(int, input().split())) +li.sort() +lin = li[:] +if sum(li) % 2 != 3 * li[2] % 2: +    lin[2] += 1 +print(((lin[2] * 3 - sum(li)) // 2))