s = input()
ans = 0
while True:
    a = s.count('01')
    ans += 2*a
    s = s.replace('01', '')
    
    b = s.count('10')
    ans += 2*b
    s = s.replace('10', '')

    if not a and not b:
        break
print(ans)
