s = str(input())
cnt=0
while len(s)//2 >0:
    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', '') 
    else:
        print(cnt)
        break
    print(cnt)