n,q=gets.split.map(&:to_i)
s=gets.chomp.chars
maths=[]
n.times do |count|
  maths << [s[count],1]
  count+=1
end
deleteNumber = 0
q.times do
  t_q,d_q=gets.chomp.split(" ")
  renges = d_q == "L" ? (0..(n-1)) : (0..(n-1)).to_a.reverse
  renges.each do |index|
    if t_q == maths[index][0]
      tempIndex = d_q == "L" ? index-1 : index+1
      tempNumber = maths[index][1]
      maths[index][1] = 0
      if tempIndex >= 0 && tempIndex < n
        maths[tempIndex][1] += tempNumber 
      else
        deleteNumber += tempNumber
      end
    end
  end
end
puts n - deleteNumber