S = input()
L = [i for i in S]
K = len(S)
i = 0
while True:    
    if i == len(L)-1 or i > K:
        break
    if L[i:i+2] == ['1','0'] or L[i:i+2] == ['0','1']:
        del L[i:i+2]
        i = 0
    else:
        i += 1
print(K-len(L))