A,B,C = map(int,input().split())
abc = [A,B,C]
Even = []
Odd = []
for i in range(3):
    if min(abc) == abc[i]:
        idx1 = i
    elif max(abc) == abc[i]:
        idx3 = i
    else:
        idx2 = i
    if abc[i]%2 == 0:
       Even += [i]
    else:
       Odd += [i]
       
ans = 0

if len(Even) == 3 or len(Odd) == 3:
    ans = (abc[idx3]-abc[idx2])//2 + (abc[idx3]-abc[idx1])//2
elif len(Even) == 2:
    ans += 1
    abc[Even[0]] += 1
    abc[Even[1]] += 1
    ans += (abc[idx3]-abc[idx2])//2 + (abc[idx3]-abc[idx1])//2
elif len(Odd) == 2:
    ans += 1
    abc[Odd[0]] += 1
    abc[Odd[1]] += 1
    ans += (abc[idx3]-abc[idx2])//2 + (abc[idx3]-abc[idx1])//2
    
print(ans)
    

