string = input()

start_length = len(string)

while len(string) > 0:
  if "10" in string:
    string = string.replace("10", "")
  elif "01" in string:
    string = string.replace("01", "")
  else:
    break

print(start_length - len(string))