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: #!/usr/bin/env python3
  #%% for atcoder uniittest use
  import sys
  input= lambda: sys.stdin.readline().rstrip()
  def pin(type=int):return map(type,input().split())
  def tupin(t=int):return tuple(pin(t))
  def lispin(t=int):return list(pin(t))
  #%%code
  from collections import  Counter
  def resolve():
      N,=pin()
      C=input()
      X=Counter(C)
      a=(min(X["R"],X["W"]))#すべての色を変えにしてしまったらいい時
      c=list(C)
  
  
      rightlimit_R=-1
      for i in range(1,N):
          if c[-i]=="R":
              rightlimit_R=N-i
              break
      cnt=0
  
      for i in range(N):
  
          if c[i]=="W":
  
              for j in range(rightlimit_R-1,0,-1):
                  if c[j]=="R":
  
                      
                      rightlimit_R=j
                      break
  
              cnt+=1
          if rightlimit_R<=i:
              
              break
  
  
      print(min(a,cnt))
      
  #%%submit!
  resolve()
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"}]