n, q = gets.split(' ').map(&:to_i)
cells = Array.new(n + 2, 1)
cells[0] = 0
cells[n + 1] = 0
s = gets.split('')

def move_golem(head_num, s, d, t, cells)
  i = s.index(t)
  return if (i == nil)
  index = head_num + i + 1

  if d == 'L' then
    cells[index - 1] += cells[index]
  else
    cells[index + 1] += cells[index]
  end
  cells[index] -= 1 if cells[index] > 0

  move_golem(index, s.slice(i + 1, s.length - 1), d, t, cells)
end

(0...q).each do |_|
  t, d = gets.split(' ')
  move_golem(0, s.dup, d, t, cells)
end

puts n - cells[0] - cells[n + 1]