n,q = map(int,input().split())
s = input()
di = {}
for j in range(n):
    if s[j] not in di:
        indexes = [i for i, x in enumerate(s) if x == s[j]]
        di[s[j]] = indexes

def python_list_add(l,num,bo,bo_s):
    for i in range(len(l)):
        l[i] = l[i] + num

    if bo_s-1 in l:
        l.remove(bo_s-1)
        bo = bo-1
    if bo in l:
        l.remove(bo)
        bo_s = bo_s+1
    return l,bo,bo_s
st = 0
for cnt in range(q):
    t,q = input().split()
    if t in di.keys():
        if q == "R":
            temp_ls,n,st = python_list_add(di[t],1,n,st)
            del di[t]
            di[t] = temp_ls
        else:
            temp_ls,n,st = python_list_add(di[t],-1,n,st)
            del di[t]
            di[t] = temp_ls

cnt = 0
for aa in di.values():
    for t in aa:
        if st <= t < n:
            cnt = cnt +1
print(cnt)