
ar = gets.chomp.split(" ").map{|i|i = i.to_i}
n=ar[0]
q=ar[1]
s = gets.chomp!
h = {}
i = 0
s.chars{|c|
    if h.include?(c) == true then 
        h[c] << i
    else 
        h[c] = [i]
    end
    i+=1
}
#pp h
order = {"L"=>-1,"R"=>1}
gorem = Array.new(n,1)
q.times do|i|
    ar = gets.chomp.split(" ")
    t = ar[0]
    d = ar[1]
    ii=0
    if h.include?(t) then
        h[t].each do|h_i|
            kari = gorem[h_i]
            gorem[h_i]=0
            j=h_i+order[d]
            if j>-1 && j<n then
                gorem[j] +=kari
            #else gorem
            end
        end
    end
    #puts "now gorem = #{gorem}"

    #puts "ii=#{ii}"
end
#pp s
#pp "t=",t
#pp "d=",d
#pp "first gorem=",gorem
#pp gorem
cc=0
gorem.each do|count|
    cc+=count
end

puts cc