S = input()
ans = len(S)
while True:
    if S.find('01') >= 0:
        S = S.replace('01', '')
    if S.find('10') >= 0:
        S = S.replace('10', '')
    else:
        break
ans -= len(S)
print(ans)
