output_description: Print the maximum number of cubes that can be removed.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      S
attempt: # -*- coding: utf-8 -*-
  
  # 入力された文字列
  string = input()
  
  # 最大処理数。100000以下なら文字列長。
  max = min(len(string), 100000)
  
  # 削除した文字数
  del_count = 0
  
  # 削除があった場合True
  del_flg = True
  
  # 削除文字がなくなるまでループする
  while del_flg:
      del_flg = False
  
      #
      for idx in range(max):
          if idx == max or idx > max:
              break
  
          # 照合対象の文字を切り出す
          target = string[idx : idx + 2]
  
          if target == "01" or target == "10":
              # 削除文字に一致した場合、元の文字列からそれを削除しカウントを進め、
              # 削除フラグを立てる
              string = string.replace(string[idx : idx + 2], "")
              del_count += 2
              max -= 2
              del_flg = True
  
  print(del_count)
  
problem_description: Statement
  
  There are N cubes stacked vertically on a desk.
  
  You are given a string S of length N. The color of the i-th cube from the
  bottom is red if the i-th character in S is `0`, and blue if that character is
  `1`.
  
  You can perform the following operation any number of times: choose a red cube
  and a blue cube that are adjacent, and remove them. Here, the cubes that were
  stacked on the removed cubes will fall down onto the object below them.
  
  At most how many cubes can be removed?
samples: [{"input": "0011", "output": "4\n    \n\nAll four cubes can be removed, by performing the operation as follows:\n\n  * Remove the second and third cubes from the bottom. Then, the fourth cube drops onto the first cube.\n  * Remove the first and second cubes from the bottom.\n\n* * *"}, {"input": "11011010001011", "output": "12\n    \n\n* * *"}, {"input": "0", "output": "0"}]