stdin = gets.chomp.split(" ").map {|i| i.to_i}
masu_num = stdin[0]
magic_num = stdin[1]
masu = gets.chomp.split("")
masu = masu.map{|m| [m, 1]}

magic_num.times do 
    magic = gets.chomp.split(" ")
    result = []
    masu.each_with_index do |elem, index|
        if elem[0] == magic[0]
            if magic[1] == "L"
                point = index-1
                if 0>point
                    masu[index][1] = 0
                    next
                end
                result.push([point, elem[1]])
                masu[index][1] = 0
            else #R
                point = index+1
                if point>=masu_num
                    masu[index][1] = 0
                    next
                end
                result.push([point, elem[1]])
                masu[index][1] = 0
            end
        end
    end
    result.each { |e| masu[e[0]][1] += e[1] }
end
sum = 0
masu.each do |e|
    sum += e[1]
end
print sum