s = input()
cnt = 0
a = 0
while True:
    fidx = s.find('10')
    if fidx==-1:
        a = 1
    cnt += s.count('10')
    s = s.replace('10', '')
    fidx = s.find('01')
    if (fidx==-1)and(a==1):
        break
    cnt += s.count('01')
    s = s.replace('01', '')
print(cnt*2)
