n,q=map(int,input().split())
s=input()
p=[[0]*n for i in range(26)]
e=n
for i in range(n):
    p[ord(s[i])-ord("A")][i]=1
for i in range(q):
    t,l=map(str,input().split())
    k=ord(t)-ord("A")
    d=p[k]
    if l=="R":
        if d[-1]==1:
            e-=1
        p[k]=[0]+d[:-1]
    else:
        if d[0]==1:
            e-=1
        p[k]=d[1:]+[0]
print(e)