n,q = gets.chomp.split.map(&:to_i)
s = gets.chomp
ar = Array.new(n){1}
uq = s.split("").uniq
set = {}
uq.each do |chr|
	set[chr] = []
end

s.split("").each_with_index do |chr,idx|
	set[chr] << idx
end

readlines.each do |item|
	temp = item.chomp.split
	set[temp[0]].each do |idx|
		ar[idx] -= 1 if ar[idx] > 0
		if temp[1] = "L"
			ar[idx - 1] += 1 if (idx - 1) >= 0
		else 
			ar[idx + 1] += 1 if (idx + 1) < n
		end
	end
end

puts ar.inject(:+)