S = input()

ct = 0
while True:
    ct += S.count('01')
    S = S.replace('01', '')
    ct += S.count('10')
    S = S.replace('10', '')
    if not S.count('01') and not S.count('10'):
        break

print(ct*2)
