data = list(map(int, input().split()))
maps = list(input())
placenum = []
for i in range(data[0]):
    placenum.append([maps[i],1])
count = data[0]
for j in range(data[1]):
    magic = input().split()
    if placenum[0][0] == magic[0]:
        if magic[1] == "L":
            count -= placenum[0][1]
            placenum[0][1] = 0
        else:
            placenum[1][1] += placenum[0][1]
            placenum[0][1] = 0
            
    for k in range(1,data[0]-1):
        if placenum[k][0] == magic[0]:
           if magic[1] == "L":
                placenum[k-1][1] += placenum[k][1]
                placenum[k][1] = 0
           else:
               placenum[k+1][1] += placenum[k][1]
               placenum[k][1] = 0
                
    if placenum[data[0]-1][0] == magic[0]:
        if magic[1] == "R":
            count -= placenum[data[0]-1][1]
            placenum[data[0]-1][1] = 0
        else:
            placenum[data[0]-2][1] += placenum[data[0]-1][1]
            placenum[data[0]-1][1] = 0
        
print(count)