n, q = map(int, input().split())
s = input()
sx = [[] for i in range(26)]

for i in range(0,n):
	sx[ord(s[i]) - 65].append(i+1)

def pl(n):
	return n + 1

def mi(n):
	return n - 1

for i in range(0, q):
	mon, di = map(str,input().split())
	cha = ord(mon)-65
	if len(sx[cha]) == 0:
		continue
	if di == "R":
		if(sx[cha][-1] == n):
			sx[cha].pop(-1)
		sx[cha] = list(map(pl,sx[cha]))
	else:
		if(sx[cha][0] == 1):
			sx[cha].pop(0)
		sx[cha] = list(map(mi,sx[cha]))
	print(sx)		
	
sum = 0
for i in range(26):
	sum += len(sx[i])	
print(sum)