import copy as copy
s = input()

def func(val, n):
    if len(val) < 2:
        return n
    a=0
    b=0    
    if '01' in val:
        a = func(copy.copy(val.replace('01', '', 1)), n+2)
    if '10' in val:
        b = func(copy.copy(val.replace('10', '', 1)), n+2)
    
    return max(a, b, n)

print(func(s, 0))
