if __name__ == '__main__':
    import sys
    input = sys.stdin.readline

    n, q = map(int, input().split())
    s = input()

    new_s = '0' + s + '1'
    c = {}

    for i,j in enumerate(s):
        try:
            c[j].append(i+1)
        except KeyError:
            c[j] = [i+1]

    ans_list = [1] + [0]*n + [1]

    operate = [[0,0] for _ in range(q)]

    direction = {'L':-1, 'R':1}

    for i in range(q):
        k = operate[i]
        k[0], k[1] = input().split()
    for t, d in operate[::-1]:
        this_operate = direction[d]
        add_list = []
        try:
            for i,num in enumerate(c[t]):
                if ans_list[num+this_operate] == 1:
                    add_list.append(num)
                    c[t].pop(i)
            for num in add_list:
                ans_list[num] = 1
        except KeyError:
            pass
    print(n-sum(ans_list)+2)
