S = raw_input()
S = str(S)

counter = 0


while True:
    killer = 0

    killer += int(S.count('10'))
    S = S.replace('10','')

    killer += int(S.count('01'))
    S = S.replace('01','')

    counter += int(killer)

    if killer == 0:
        break
print counter * 2
