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