s = input()
r = 0
while True:
    z = s.count('01')
    o = s.count('10')
    if z+o == 0:
        break
    elif z > o:
        s = s.replace('01', '')
        r += z
    else:
        s = s.replace('10', '')
        r += o
print(2*r)