S = input()
counter = 0
ans_bf = len(S)
while True:
    len_bf = len(S)
    for i in range(0,(len_bf-1)):
        if (S[i] == '0' and S[i+1] == '1') or(S[i] == '1' and S[i+1] == '0') :
            S = S[:i]+S[i+2:]
            break
    if len_bf == len(S):
        break
print(ans_bf - len(S))
