S = list(input())
pop_count = 0
cont_count = 0

while True:
    for i in range(1, len(S)):
        if S[i] == "0":
            if S[i-1] == "0":
                cont_count += 1
                continue
            else:
                S.pop(i)
                S.pop(i-1)
                pop_count += 2
                break
        else:
            if S[i-1] == "1":
                cont_count += 1
                continue
            else:
                S.pop(i)
                S.pop(i-1)
                pop_count += 2
                break
    if cont_count == len(S) or len(S) == 0:
        break

print(pop_count)