def trim(s):
    for i in range(len(s)-1):
        if (s[i]=="0" and s[i+1]=="1") or (s[i]=="1" and s[i+1]=="0"):
            s=s[:i]+s[i+2:]
            break
    else: return False
    return s
s=input()
c=-1
while s:
    c+=1
    s=trim(s)
print(c*2)