#! /usr/bin/env python
# -*- coding: utf-8 -*-

if __name__ == '__main__':
    # init char list
    charList = [chr(s) for s in range(65, 91)] # A-Z

    N, Q = map(int, input().split()) # N, Q for number

    sN = list(input())  # squares
    sList = [None] * 26
    gList = [i for i in range(0,N)]  # golems
    for i in range(0, len(sN)): # init
        if(sList[charList.index(sN[i])] == None):
            sList[charList.index(sN[i])] = [{'id':i, 'loc':i}]
        else:
            sList[charList.index(sN[i])].append({'id':i, 'loc':i})

    sQ = []

    for i in range(0, Q):
        t, d = input().split()
        sQ.append({'t': t, 'd': d})

    remain = len(sN)
    for q in sQ: # loop to handle Q
        for golem in sList[charList.index(q['t'])]:
            if(q['d'] == 'L'):
                if(golem['loc'] == 0):
                    remain = remain - 1
                    golem['loc'] = -1  # drop
                    sList[sN.index(q['t'])].remove({'id': golem['id'],'loc': -1})
                elif(golem['loc'] > 0):
                    sList[sN.index(q['t'])].remove({'id': golem['id'],'loc': golem['loc']})
                    golem['loc'] = golem['loc'] - 1
                    sList[sN.index(golem['loc'])].append({'id': golem['id'],'loc': golem['loc']})
            elif(q['d'] == 'R'):
                if(golem['loc'] == remain - 1):
                    remain = remain - 1
                    golem['loc'] = -1  # drop
                    sList[sN.index(q['t'])].remove({'id': golem['id'],'loc': -1})
                elif (golem['loc'] > 0):
                    sList[sN.index(q['t'])].remove({'id': golem['id'],'loc': golem['loc']})
                    golem['loc'] = golem['loc'] + 1
                    sList[sN.index(golem['loc'])].append({'id': golem['id'],'loc': golem['loc']})

    print(remain)

