-- C
local DBG = false
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 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")
dbgpr(N, Q, s)
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 places = {}
local AA, ZZ = string.byte("AZ", 1, 2)
for i=AA,ZZ do
    local c = string.char(i)
    places[c] = {}
end

local count = {}
for i=1,N do
    local c = string.sub(s, i, i)
    table.insert(places[c], i)
    count[i] = 1
end
for i=AA,ZZ do
    local c = string.char(i)
    dbgpr(c)
    dbgpr_t(places[c])
end

local dead = 0
for i=1,Q do
    local t, d = spells[i][1], spells[i][2]
    local a = (d == 'L') and -1 or 1
    for _,v in ipairs(places[t]) do
        if count[v] > 0 then
            local oldcount = count[v]
            count[v] = 0
            if v + a <= 0 then
                dead = dead + oldcount
            elseif v + a > N then
                dead = dead + oldcount
            else
                count[v+a] = count[v+a] + oldcount
            end
        end
    end
    dbgpr_tp(count)
end
print(N - dead)