#coding: euc-jp
n, q = gets.chomp.split.map(&:to_i)
s = gets.chomp
golem = Array.new(n, 1)
chara = Array.new(26).map{Array.new(0)}
n.times do |i|
  a = s[i].ord - 'A'.ord
  chara[a] += [i]
end
q.times do
  t, d = gets.chomp.split
  a = t.ord - 'A'.ord
  case d
  when 'L'
    chara[a].each do |i|
      golem[i - 1] += golem[i] if i != 0
      golem[i] = 0
    end
  when 'R'
    chara[a].reverse.each do |i|
      golem[i + 1] += golem[i] if i != n - 1
      golem[i] = 0
    end
  end
end
puts golem.inject(:+)
