import re
S = (input())
advance = len(S)
ans = 0
while True:  
    count = re.findall("01",S)
    S = S.replace("01","")
    ans+=len(count)*2
    count = re.findall("10",S)
    S = S.replace("10","")
    ans+=len(count)*2
    if advance==len(S):
        break
    advance = len(S)
print(ans)