def main():
  s = input()
  
  answer = 0
  
  while ("0" in s) and ("1" in s):
    answer += s.count("10")
    s = s.replace("10", "")
    answer += s.count("01")
    s = s.replace("01", "")
  
  print(answer * 2)


if __name__ == "__main__":
  main()
