s = list(map(int, list(input())))
ls = len(s)
while True:
    f = False
    for i in range(len(s)-1):
        if (s[i] ==0 and s[i+1] ==1) or (s[i] ==1 and s[i+1] ==0):
            del s[i:i+2]
            f = True
            break
    if f == False:
        break
print(ls-len(s))