def ints
  gets.split.map(&:to_i)
end

N, Q = ints
s = gets.strip

locs = Hash.new{|h, k| h[k] = [] }
s.chars.each.with_index do |c, i|
  locs[c] << i
end

Q.times do
  t, d = gets.split

  loc = locs[t]
  locs[t] = []

  loc.map do |l|
    nl = l + (d == 'L' ? -1 : 1)
    if 0 <= nl && nl < N
      locs[s[nl]] << nl
    end
  end
end

ans = locs.values.flatten.count
puts ans
