output_description: Print an integer representing the minimum number of operations needed.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      c_{1}c_{2}...c_{N}
attempt: def popcount(x):
      """xの立っているビット数をカウントする関数
      (xは64bit整数)"""
  
      # 2bitごとの組に分け、立っているビット数を2bitで表現する
      x = x - ((x >> 1) & 0x5555555555555555)
  
      # 4bit整数に 上位2bit + 下位2bit を計算した値を入れる
      x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
  
      x = (x + (x >> 4)) & 0x0F0F0F0F0F0F0F0F  # 8bitごと
      x = x + (x >> 8)  # 16bitごと
      x = x + (x >> 16)  # 32bitごと
      x = x + (x >> 32)  # 64bitごと = 全部の合計
      return x & 0x0000007F
  
  
  n = int(input())
  data = input()
  c = 0
  countR = 0
  mask = 0
  for i in range(len(data)):
      # print(i)
      # print(data[i])
      if i != 0:
          c = c << 1
      ci = data[i]
      if ci == "R":
          countR += 1
      else:
          c += 1
  for i in range(n - countR):
      mask += 1
      mask = mask << 1
  mask = mask << countR - 1
  # print(bin(c))
  # print(bin(mask))
  # print(countR)
  print(popcount(c & mask))
  
problem_description: Statement
  
  An altar enshrines N stones arranged in a row from left to right. The color of
  the i-th stone from the left (1 \leq i \leq N) is given to you as a character
  c_i; `R` stands for red and `W` stands for white.
  
  You can do the following two kinds of operations any number of times in any
  order:
  
    * Choose two stones (not necessarily adjacent) and swap them.
    * Choose one stone and change its color (from red to white and vice versa).
  
  According to a fortune-teller, a white stone placed to the immediate left of a
  red stone will bring a disaster. At least how many operations are needed to
  reach a situation without such a white stone?
samples: [{"input": "4\n    WWRR", "output": "2\n    \n\nFor example, the two operations below will achieve the objective.\n\n  * Swap the 1-st and 3-rd stones from the left, resulting in `RWWR`.\n  * Change the color of the 4-th stone from the left, resulting in `RWWW`.\n\n* * *"}, {"input": "2\n    RR", "output": "0\n    \n\nIt can be the case that no operation is needed.\n\n* * *"}, {"input": "8\n    WRWWRWRR", "output": "3"}]