(N, Q) = gets.split.map(&:to_i)
s = gets.chomp

data = {}
N.times do |i|
  ss = s[i]
  if data[ss].nil?
    data[ss] = []
  end

  data[ss] << i
end

rdata = Array.new(N, 1)

sum = 0
Q.times do
  input = gets.split
  next unless data[input[0]]

  if input[1] == 'L'
    data[input[0]].each do |n|
      next if rdata[n] == 0

      if n == 0
        sum += rdata[0]
        rdata[0] = 0
      else
        rdata[n - 1] += rdata[n]
        rdata[n] = 0
      end
    end
  else
    data[input[0]].reverse.each do |n|
      next if rdata[n] == 0

      if n == N - 1
        sum += rdata[N - 1]
        rdata[N - 1] = 0
      else
        rdata[n + 1] += rdata[n]
        rdata[n] = 0
      end
    end
  end
end

puts N - sum