S = input()
s_len = len(S)
ahead = len(S)
now = len(S)
while(True):
    S = S.replace('01', '').replace('10', '')
    ahead = now
    now = len(S)
    if(ahead == now):
        break
print(s_len - len(S))