S = list(map(int, list(input())))
before = len(S)

if 0 not in S:
    print(0)
elif 1 not in S:
    print(0)

else:
    while True:
        if 0 not in S:
            after = len(S)
            break
        elif 1 not in S:
            after = len(S)
            break
        
        for i in range(before - 2):
            if S[i] == 1 and S[i + 1] == 0:
                S.pop(i)
                S.pop(i)
                break
            elif S[i] == 0 and S[i + 1] == 1:
                S.pop(i)
                S.pop(i)
                break
    print(before - after)