n, q = gets.chomp.split.map(&:to_i)
hs = Hash.new
s = gets.chomp
cnt = Hash.new(0)

0.step(n - 1) do |i|
  hs[s[i]] ||= []
  hs[s[i]] << i + 1
  cnt[i + 1] += 1
end

q.times do
  t, d = gets.chomp.split
  next if hs[t].nil?
  hs[t].each do |i|
    if d == "L"
      cnt[i - 1] += cnt[i]
      cnt[i] = 0
    elsif d == "R"
      cnt[i + 1] += cnt[i]
      cnt[i] = 0
    end
  end
end
puts n - cnt[0] - cnt[n + 1]