import Data.Array

main = do
  n <- readLn
  cs <- getLine
  let ar = listArray (1, n) cs
  print $ f 1 n ar 0

f l r ar i
  | r <= l = i
  | ar ! l == 'R' = f (l + 1) r ar i
  | ar ! r == 'W' = f l (r -1) ar i
  | otherwise = f (l + 1) (r -1) ar (i + 1)
