s = input()
cnt=0
 
for i in range(len(s)//2):
    if '10' in s:
        cnt+=2 * s.count('10')
        s=s.replace('10', '') 
    elif '01' in s:
        cnt+=2 * s.count('01')
        s=s.replace('01', '') 
print(cnt)