n,q= list(map(int, input().split()))
s=input()
S=[1]*n
#a = [input().split() for _ in range(q)]
counter=0

for i in range(q):
    t,d=list(map(int, input().split()))
    for 
    if t == s[0] and d == "L" or s[n-1]== t and d =="R":
        counter+=1
        