N,Q  =map(int,input().split())
s = input()
buffer = []
Spels = []
Cells = [False]*N
def SpelSearch(place,q):
  #print(" " + str(place) + " " +str(q))
  for i in range(Q):
    q += 1
    if q >= Q:
      return
    if Spels[q][1] == "R" :
      if place-1 >= 0:
        if Spels[q][0] == s[place-1]:
          Cells[place-1] = True
          SpelSearch(place-1,q)
    if Spels[q][1] == "L" :
      if place + 1 < N:
        if Spels[q][0] == s[place+1]:
          Cells[place+1] = True
          SpelSearch(place+1,q)
for i in range(Q):
  buffer= list(input().split())
  Spels.append(buffer)
Spels.reverse()
#print(Spels)
for q in range(Q):
  if Spels[q][1] == "R" and Spels[q][0] == s[N-1]:
    Cells[N-1] = True
    SpelSearch(N-1,q)
  if Spels[q][1] == "L" and Spels[q][0] == s[0]:
    Cells[0] = True
    SpelSearch(0,q)
#print(Cells)
print(Cells.count(False))