-- 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 left, right
local left_path, right_path = 0, N+1

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
            left_path = 1
            flag = false
            left = true
        end
    else
        if t == place[N] and not right then
            right_path = N
            flag = false
            right = true
        end
    end
    if flag then
        if d == 'L' and left then
            if t == place[left_path+1] then
                left_path = pos+1
            end
        elseif right then
            if t == place[right_path-1] then
                right_path = pos-1
            end
        end
    end
end

local dead = 0
for i=1,N do
    if i <= left_path or i >= right_path then
        dead = dead + 1
    end
end
print(N - dead)