-- C
local DBG = true
local function dbgpr(...)
    if DBG then
        io.write("[dbg]")
        print(...)
    end
end

local function dbgpr_t(tbl, use_pairs)
    if DBG then
        local enum = ipairs
        if use_pairs then
            enum = pairs
        end
        dbgpr(tbl)
        io.write("[dbg]")
        for i,v in enum(tbl) do
            io.write(i)
            io.write(":")
            io.write(tostring(v))
            io.write(" ")
        end
        print("")
    end
end

local function dbgpr_tp(tbl)
    dbgpr_t(tbl, true)
end

local function str2tbl(s)
    local t = {string.byte(s, 1, #s)}
    for i=1, #t do
        t[i] = string.char(t[i])
    end
    return t
end

local function each_char(s)
    local f = function(_, i)
        i = i + 1
        if i <= #s then
            return i, string.sub(s, i, i)
        end
    end
    return f, nil, 0
end
local N, Q, _ = io.read("n", "n", "l")
local s = io.read("l")
assert(#s == N)
local spells = {}
for i=1,Q do
    local t, _, d, _ = io.read(1, 1, 1, "l")
    spells[i] = {t, d}
end

local place = str2tbl(s)

local paths = {}

local function new_path(pos)
    local p = {pos, 1}
    return p
end
local function push_path(p)
    table.insert(paths, p)
end

local death = {}
for i=1,N do
    death[i] = false
end

for i=Q,1,-1 do
    local t, d = spells[i][1], spells[i][2]
    local flag = true
    if d == 'L' then
        if t == place[1] and not left then
            local p = new_path(1)
            push_path(p)
            death[1] = true
            flag = false
            left = true
        end
    else
        if t == place[N] and not right then
            local p = new_path(N)
            push_path(p)
            death[N] = true
            flag = false
            right = true
        end
    end
    if flag then
        for _,p in ipairs(paths) do
            local pos, count = p[1], p[2]
            if d == 'L' then
                if t == place[pos+1] then
                    p[1], p[2] = pos+1, count+1
                    death[pos+1] = true
                end
            else
                if t == place[pos-1] then
                    p[1], p[2] = pos-1, count+1
                    death[pos-1] = true
                end
            end
        end
    end
end
local dead = 0
for i=1,N do
    if death[i] then
        dead = dead + 1
    end
end
print(N - dead)