nq = (gets).split(" ")
nn = nq[0].to_i
qq = nq[1].to_i
names = gets

golems = (0..nn).to_a

commands = []
qq.times do |n|
    inputs = (gets).split(" ")
    d = true
    if inputs[1] == 'R' then
       d = false
    end
    commands.push({"target": inputs[0], "direct": d})
end

commands.each_with_index do |cmd, cnt|
    s = cmd[:target]
    direct = cmd[:direct]
    golems.map! do |golem|
        p = golem
        if (p >= 0 && names[p] == s) then
            if direct then
                p = p - 1
            else
                p = p + 1
            end
         end
         if (p < 0 || p >= nn) then
             p = -1
         end
         golem = p
    end
    if (cnt.modulo(100) == 99) then
        golems.delete(-1)
    end
end
golems.delete(-1)

puts golems.length