using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace C
{
    public class Program

    {
        public static void Main(string[] args)
        {
            HashSet<int>[] chars = new HashSet<int>[26];
            for (int i = 0; i < chars.Length; i++)
            {
                chars[i] = new HashSet<int>();
            }

            int[] vs = RIntAr();
            string s = RSt();

            int[] golems = new int[s.Length];
            for (int i = 0; i < s.Length; i++)
            {
                chars[s[i] - 'A'].Add(i);
                golems[i] = 1;
            }

            int disappeared = 0;
            for (int i = 0; i < vs[1]; i++)
            {
                string[] items = RStAr();

                if (items[1][0] == 'R')
                {
                    foreach (var item in chars[items[0][0] - 'A'].OrderByDescending(x => x))
                    {
                        int tmp = golems[item];
                        golems[item] = 0;
                        if (item + 1 < s.Length)
                        {
                            golems[item + 1] += tmp;
                        }
                        else
                        {
                            disappeared += tmp;
                        }
                    }
                }
                else
                {
                    foreach (var item in chars[items[0][0] - 'A'].OrderBy(x => x))
                    {
                        int tmp = golems[item];
                        golems[item] = 0;
                        if (item - 1 >= 0)
                        {
                            golems[item - 1] += tmp;
                        }
                        else
                        {
                            disappeared += tmp;
                        }
                    }
                }

            }

            Console.WriteLine(s.Length - disappeared);
        }

        static string RSt() { return Console.ReadLine(); }
        static int RInt() { return int.Parse(Console.ReadLine().Trim()); }
        static long RLong() { return long.Parse(Console.ReadLine().Trim()); }
        static double RDouble() { return double.Parse(Console.ReadLine()); }
        static string[] RStAr(char sep = ' ') { return Console.ReadLine().Trim().Split(sep); }
        static int[] RIntAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => int.Parse(e)); }
        static long[] RLongAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => long.Parse(e)); }
        static double[] RDoubleAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => double.Parse(e)); }
        static string WAr<T>(IEnumerable<T> array, string sep = " ") { return string.Join(sep, array.Select(x => x.ToString()).ToArray()); }
    }

}
