N, Q = gets.split(" ").map(&:to_i)
s = gets.chomp
L = Hash.new(0)
R = Hash.new(0)
Q.times do
    t, d = gets.split(" ")
    if d == 'L'
        L[t] += 1
    else d == 'R'
        R[t] += 1;
    end
end

s = s.split("")
cnt = 0
s.each do |c|
    if L[c] > 0
        L[c] -= 1
        cnt += 1
    end
end
s.reverse_each do |c|
    if R[c] > 0
        R[c] -= 1
        cnt += 1
    end
end
puts N - cnt
