n, q = (int(x) for x in input().split())
s = input().rstrip()

masu_s = []
masu_g = []
for i in range(n):
	masu_s.append = s[i]
	masu_g.append = 1

for i in range(q):
	t, d = input().split()

	count = 0
	if i == t:
		if d == 'R':
			if i == n:
				masu_g[i] = 0
			if masu_g[i] > 0:
				count = masu_g[i]
				masu_g[i+1] += count
				masu_g[i] = 0
		if d == 'L':
			if i == 0:
				masu[i] = 0
			if masu_g[i] >0:
				count = masu_g[i]
				masu_g[i-1] += count
				masu_g[i] = 0
		count = 0

for i in masu_g:
	count += i

print(count)