N,Q = map(int, input().split())
s = input()
field = [1] * N
count = 0
for i in range(Q):
    t,d = input().split()
    if d == "R":
        s_ = s[::-1]
        for j in range(N):
            if s_[j]==t:
                if j==0:
                    count += field[N-1]
                    field[N-1] = 0
                else:
                    field[N-j] += field[N-1-j]
                    field[N-1-j] = 0
    else:
        for j in range(N):
            if s[j]==t:
                if j==0:
                    count += field[0]
                    field[0] = 0
                else:
                    field[j-1] += field[j]
                    field[j] = 0
print(N-count)