class Golems:
    def __init__(self, pos_i, pos_c):
        self.pos_i = pos_i
        self.pos_c = pos_c

def main():
    inputs = input()

    n = 0
    q = 0
    sped = inputs.split(" ")
    n = int(sped[0])
    q = int(sped[1])

    s = input()

    golem_list = []
    pos_cnt = 1
    for c in s:
        golem_list.append(Golems(pos_cnt, c))
        pos_cnt += 1

    t_list = []
    d_list = []
    for i in range(q):
        inputs = input()
        sped = inputs.split(" ")
        t_list.append(sped[0])
        d_list.append(sped[1])

    turn_cnt = 0
    pos_cnt = 1
    for zyumon in d_list:
        effect_pos = t_list[turn_cnt]
        for golem in golem_list:
            if golem.pos_c == effect_pos:
                if zyumon == 'L' and golem.pos_i <= n:
                    golem.pos_i -= 1
                    try:
                        golem.pos_c = s[golem.pos_i-1]
                    except:
                        continue
                elif zyumon == 'R' and golem.pos_i > 0:
                    golem.pos_i += 1
                    try:
                        golem.pos_c = s[golem.pos_i-1]
                    except:
                        continue

        turn_cnt += 1
    ans_cnt = 0
    for golem in golem_list:
        if golem.pos_i >= 1 and golem.pos_i < n:
            ans_cnt += 1
    print(ans_cnt)

if __name__ == '__main__':
    main()
