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: import math
  
  # import bisect
  import sys
  
  # from collections import Counter
  input = sys.stdin.readline
  
  
  def inp():
      return int(input())
  
  
  def inlt():
      return list(map(int, input().split()))
  
  
  def insr():
      s = input()
      return s[: len(s) - 1]
  
  
  def invr():
      return map(int, input().split())
  
  
  def print_fract(p, q):
      g = math.gcd(p, q)
      p //= g
      q //= g
      print(str(p) + "/" + str(q))
  
  
  # list1, list2 = zip(*sorted(zip(list1, list2)))
  # K = inp()
  # if K%2 == 0 or K%5 == 0:
  # 	print(-1)
  # else:
  # 	i = 7
  # 	while True:
  # 		if len(str(i)) == 999982:
  # 			break
  # 		if i%K == 0:
  # 			print(len(str(i)))
  # 			break
  # 		i = (10*i) + 7
  # 777777777777
  N = inp()
  S = insr()
  print(S[: S.count("R")].count("W"))
  
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"}]