#import time
#t1 = time.time()
n, q = list(map(int,input().split()))
s = input()
s2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
#t2 = time.time()
miti = [1]*(n+2) #ますにいるゴーレムの数
kazu = {} #dict型 keyのマスの場所
for i in s2 :
    kazu[i] = []
for i in range(len(s)) :
    kazu[s[i]].append(i+1)
#print(kazu)
#t3 = time.time()
for _ in range(q) :
    i = input().split()
    if i[1] == "L" :
        for j in kazu[i[0]] :
            miti[j-1] += miti[j]
            miti[j] = 0
    else :
        for j in kazu[i[0]][::-1] :
            miti[j+1] += miti[j]
            miti[j] = 0
        #print(miti)
print(n+2-miti[0]-miti[-1])
#t4 = time.time()
#print(miti)
#print(kazu)
#print(t2-t1,t3-t2,t4-t3)
