s = input()
cnt=0

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