{-# LANGUAGE BangPatterns #-}
import qualified Data.Vector.Unboxed   as VU
import qualified Data.ByteString.Char8 as BSC8

main :: IO ()
main = do
  n <- readLn :: IO Int
  c <- BSC8.unpack <$> BSC8.getLine
  print $ go c n 0 0 (n - 1)

go :: [Char] -> Int -> Int -> Int -> Int -> Int
go !c !n !res l r
  | l >= r || l >= n  || r < 0 = res
  | c !! l == 'R'              = go c n res (l + 1) r
  | c !! r == 'W'              = go c n res l (r - 1)
  | otherwise                  = go c n (res + 1) (l + 1) (r - 1)