S = input()
origin_length = len(S)
while(True):
  if '01' in S :
  	S=S.replace('01','')
  if '10' in S:
    S=S.replace('10','')
  if '01' not in S and '10' not in S:
    break
print(origin_length-len(S))