import re
S = input()
ans = 0

while True:
    num0 = S.count('01')
    S = re.sub('01', '', S)
    num1 = S.count('10')
    S = re.sub('10', '', S)
    ans += 2*(num0+num1)
    if num0+num1 == 0:
        print(ans)
        break
    
