import re
S = input()
ans = 0

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