import numpy as np
import copy

n,q = map(int,input().split())
s = input()
s = [a for a in s]
t = []
d = []
for i in range(q):
    _t,_d = input().split()
    t.append(_t)
    d.append(_d)

member = np.ones(n+2)
member[0] = 0
member[-1] = 0

for i in range(q):
    _t = t[i]
    _d = d[i]
    hit = np.array([i+1 for i, x in enumerate(s) if x == _t])
    if hit.shape[0] == 0:
        continue
    if _d == "R":
        _member = copy.deepcopy(member)
        member[hit] -= _member[hit]
        member[hit+1] += _member[hit]
        member[0] = 0
        member[-1] = 0
    else:
        _member = copy.deepcopy(member)
        member[hit] -= _member[hit]
        member[hit-1] += _member[hit]
        member[0] = 0
        member[-1] = 0

print(int(np.sum(member)))
