n,q = gets.chomp.split(' ').map(&:to_i)
s = gets.chomp.split('')

addr = {}

s.each_with_index do |alpha,i|
  addr.has_key?(alpha) ? addr[alpha] << i : addr[alpha] = [i]
end

cell = [1] * n

q.times do
  t , d = gets.chomp.split(" ")
  next if addr[t].nil?
  addr[t].each do |i|
    if d == "L"
      cell[i-1] += cell[i] unless i-1 < 0
    else
      cell[i+1] += cell[i] unless i+1 >= n
    end
    cell[i] = 0
  end

#  p s.join(", ")
#  p cell
end

puts cell.inject(:+)