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

if __name__ == '__main__':
    N, Q = map(int, input().split()) # N, Q for number
    sN = list(input())
    golems = []
    for i in range(0, N): # init golem
        golems.append({'loc': i, 'location':sN[i]})

    sQ = []

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

    remain = len(golems)
    for q in sQ: # loop to handle Q
        for g in golems:
            if(g['loc'] >= 0 and g['location'] == q['t']):
                if(q['d'] == 'L'):
                    if(g['loc'] > 0):
                        g['loc'] = g['loc'] - 1
                        g['location'] = sN[g['loc']]
                    else:
                        g['loc'] = -1
                        remain = remain - 1
                elif(q['d'] == 'R'):
                    if(g['loc'] < N -1):
                        g['loc'] = g['loc'] + 1
                        g['location'] = sN[g['loc']]
                    else:
                        g['loc'] = -1
                        remain = remain - 1

    print(remain)