s = 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'):
            s = s[0:i] + s[i+2:]
            f = True
            break
    if f == False:
        break
print(ls-len(s))