import re
s = str(input())
cnt=0
while len(s) >1:
    if '10' in s:
        cnt+=2 * s.count('10')
        s=re.sub('10', '',s) 
        cnt+=2 * s.count('01')
        s=re.sub('01', '',s) 
        
    elif '01' in s:
        cnt+=2 * s.count('01')
        s=re.sub('01', '',s) 
        
        cnt+=2 * s.count('10')
        s=re.sub('10', '',s) 
    else:
        break
print(cnt)