S = input()
count =0

while True:
    if '01' not in S and '10' not in S:
        break
    if '01' in S:
        a = S.count('01')
        S = S.replace('01','',a)
        count += a
        #print(S)
    if '10' in S:
        b = S.count('10')
        S = S.replace('10','',b)
        count += b
        #print(S)

#print(S)
print(count*2)