a,b = map(int,input().split())
s = str(input())
answe = a
lis = []
for i in range(a):
  lis.append(1)
def k (t,p, l):
  for i in range(0-(p-1)//2, a-(1+p)//2):
    if s[i] == t:
      l[i+p] += l[i]
      l[i] = 0
for i in range(b):
  t,u = map(str,input().split())
  if u == 'L':
    k(t,-1,lis)
  else:
    k(t,1,lis)
  if t ==s[0] and u == 'L':
    answe -= lis[0]
  elif t == s[a-1] and u =='R':
    answe -= lis[a-1]
print(answe)
