#38498: python新手解


jun103010418@gmail.com (駿陳)


def fly(a,b)->int:
    thens = abs(a-b)
    return thens
total = 0
c = list(input())
d = [int(c[i]) for i in range(len(c))]
b = 0
a = 0
for i in range(0,len(d),2):
    b+=d[i]
for i in range(1,len(d),2):
    a+=d[i]
ass = fly(a,b)
print(ass)