import Data.Vector.Unboxed ((!))
import qualified Data.Vector.Unboxed as V
import Control.Monad

data Survival = DropL | Survive | DropR deriving (Eq)

main = do
  [n,q]<-map read.words<$>getLine
  s<-getLine
  ops<-replicateM q$(\[a,b]->(a,b)).map head.words<$>getLine
  print $ solve n s ops

solve n s ops = right - left
  where
  right = findBorder ((/=DropR).eval) n
  left  = findBorder ((==DropL).eval) n
  eval = go ops
  go [] _ = Survive
  go ((t,d):ops) pos
    | t /= golems!pos = go ops pos
    | d == 'L' = if pos == 0 then DropL else go ops (pos-1)
    | d == 'R' = if pos == n-1 then DropR else go ops (pos+1)
  golems = V.fromListN n s

findBorder f = go (-1)
  where
  go l r
    | l+1 == r = l
    | f m = go m r
    | otherwise = go l m
    where m = (l+r) `div` 2