n = str(input())
motononagasa = len(n)
while '01' in n:
  n = n.replace('01', '').replace('10', '')
while '10' in n:
  n = n.replace('10', '').replace('01', '')
atononagasa = len(n)
#print(n)
print(motononagasa-atononagasa)