import numpy as np



# A, B, C = [11, 12, 15]

A, B, C = list(map(int, input().split()))





vals = np.array([A, B, C])

vals = np.sort(vals)



sumval = vals.sum()







cn = vals[-1] + np.sum(vals[:2]) % 2



n = (3 * cn - sumval) // 2



print(n)



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



mval = max(lst)

sval = sum(lst)

cn = mval + (sval-mval) % 2

n = (cn * 3 - sval) // 2

print(n)



import numpy as np

# A, B, C = [11, 12, 15]
A, B, C = list(map(int, input().split()))
vals = np.array([A, B, C])
vals = np.sort(vals)
sumval = vals.sum()
cn = vals[-1] + np.sum(vals[:2]) % 2
n = (3 * cn - sumval) // 2
print(n)

lst = list(map(int, input().split()))
mval = max(lst)
sval = sum(lst)
cn = mval + (sval - mval) % 2
n = (cn * 3 - sval) // 2
print(n)

-import numpy as np - -# A, B, C = [11, 12, 15] -A, B, C = list(map(int, input().split())) -vals = np.array([A, B, C]) -vals = np.sort(vals) -sumval = vals.sum() -cn = vals[-1] + np.sum(vals[:2]) % 2 -n = (3 * cn - sumval) // 2 +lst = list(map(int, input().split())) +mval = max(lst) +sval = sum(lst) +cn = mval + (sval - mval) % 2 +n = (cn * 3 - sval) // 2