from sys import stdin
S = stdin.readline().rstrip()
ans = 0
while(S.count('01') != 0 or S.count('10') != 0):
    # print(S)
    ans += S.count("01")
    S = S.replace('01','')
    ans += S.count('10')
    S = S.replace('10','')
print(ans*2)