n,q = map(int,input().split())
s = input()
position = []
l = 1
for c in s:
    position.append([c,l])
    l = l + 1

for l in range(q):
    T,_,D = input()
    for p in position:
        if p[0] == T:
            if D == "L":
                p[1] = p[1] - 1
            else:
                p[1] = p[1] + 1
            if p[1] == 0:
                position.remove(p)
            elif p[1] == n + 1:
                position.remove(p)

print(len(position))