import string


def solve(N, Q, S, TDs):
    ascii_map = {}
    for s in string.ascii_uppercase:
        ascii_map[s] = [i for i, c in enumerate(S) if c == s]
    ans = [0 for _ in range(N)]

    for q in TDs[::-1]:
        t, d = q
        death = ascii_map[t]
        if d == "L":
            for m in death[::-1]:
                if m - 1 >= 0 and ans[m - 1] == 1:
                    ans[m] = 1
        else:
            for m in death:
                if m + 1 < N and ans[m + 1] == 1:
                    ans[m] = 1

        if t == S[0] and d == "L":
            ans[0] = 1
        if t == S[-1] and d == "R":
            ans[N - 1] = 1

    return ans.count(0)

if __name__ == "__main__":
    N, Q = tuple(map(int, input().split(" ")))
    S = input()
    TDs = [tuple(input().split(" ")) for __ in range(Q)]
    print(solve(N, Q, S, TDs))
