
n,q = map(int,input().split())
s = input()
t = [0]*q
d = [0]*q
command = {}
command_max = {}
command_min = {}

for i in range(n):
    command[s[i]] = 0
    command_max[s[i]] = 0
    command_min[s[i]] = 0

for i in range(q):
    t[i],d[i] = input().split()

    if command[t[i]] != -1:
        
        if d[i] == "R":
            command[t[i]] += 1

            if command_max[t[i]] < command[t[i]]:
                    command_max[t[i]] = command[t[i]]
        
        else:
            command[t[i]] -= 1

            if command_min[t[i]] < command[t[i]]:
                command_min[t[i]] = command[t[i]]
    
an = 0
for i in range(n):

    if n-i >= command_max[s[i]]:
        an += 1

    elif i+1 <= command_min[s[i]]:
        an += 1


print(n - an)










