output_description: Print the maximum possible number of times the operation can be performed.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      S
attempt: 
  bws = input()
  
  count = 0
  
  def check(from, to):
    for i in range(from, to):
      if (bws[i] == 'B' && bws[i + 1] == "W"):
        count = count + 1
        bws[i] = reverse(bws[i])
        bws[i + 1] = reverse(bws[i + 1])
        check(i - 2, to)
        return
      
  def reverse(c):
    return 'W' if c == 'B' else 'B' 
  
  check(0, len(bws) - 2)
      
  print(count)
problem_description: Statement
  
  There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc
  with a black side and a white side.) The state of each piece is represented by
  a string S of length N. If S_i=`B`, the i-th piece from the left is showing
  black; If S_i=`W`, the i-th piece from the left is showing white.
  
  Consider performing the following operation:
  
    * Choose i (1 \leq i < N) such that the i-th piece from the left is showing black and the (i+1)-th piece from the left is showing white, then flip both of those pieces. That is, the i-th piece from the left is now showing white and the (i+1)-th piece from the left is now showing black.
  
  Find the maximum possible number of times this operation can be performed.
samples: [{"input": "BBW", "output": "2\n    \n\nThe operation can be performed twice, as follows:\n\n  * Flip the second and third pieces from the left.\n  * Flip the first and second pieces from the left.\n\n* * *"}, {"input": "BWBWBW", "output": "6"}]