s = input()
n = len(s)
flag = True
while flag:
    n1 = len(s)
    s = s.replace('01', '')
    s = s.replace('10', '')
    n2 = len(s)
    if n1 > n2:
        continue
    else:
        flag = False
        break

print(n-len(s))



