using System;
using System.Collections.Generic;
using System.Linq;
using BitArray = System.Collections.BitArray;
using BigInteger = System.Numerics.BigInteger;

namespace AtCoderProject
{
    public class Program
    {
        public object Calc()
        {
            var line = consoleReader.ReadLineSplitInt32();
            var N = line[0];
            var Q = line[1];

            var s = consoleReader.ReadLine();
            var golems = Enumerable.Repeat(1, N).ToArray();

            var tds = consoleReader.RepeatReadLinesSplit(Q);

            var sum = N;


            var dicIndex = new Dictionary<char, List<int>>();
            for (int i = 0; i < s.Length; i++)
            {
                List<int> list;
                if (dicIndex.TryGetValue(s[i], out list))
                {
                    list.Add(i);
                }
                else
                {
                    dicIndex[s[i]] = new List<int> { i };
                }
            }


            foreach (var td in tds)
            {
                var t = td[0][0];
                var toRight = td[1] == "R";

                List<int> list;
                if (!dicIndex.TryGetValue(t, out list)) continue;

                if (toRight)
                {
                    foreach (var i in Enumerable.Reverse(list))
                    {
                        if (i != N - 1)
                            golems[i + 1] += golems[i];
                        else
                            sum -= golems[i];
                        golems[i] = 0;
                    }
                }
                else
                {
                    foreach(var i in list)
                    {
                        if (i != 0)
                            golems[i - 1] += golems[i];
                        else
                            sum -= golems[i];
                        golems[i] = 0;
                    }
                }
            }

            return sum;
        }

        private readonly ConsoleReader consoleReader;
        public Program() : this(new ConsoleReader()) { }
        public Program(ConsoleReader consoleReader) { this.consoleReader = consoleReader; }
        static void Main() => Console.WriteLine(new Program().Calc());
    }

    public class ConsoleReader
    {
        public virtual string ReadLine() => Console.ReadLine();
        public int ReadLineInt32() => int.Parse(ReadLine());
        public long ReadLineInt64() => long.Parse(ReadLine());
        public ulong ReadLineUInt64() => ulong.Parse(ReadLine());
        public double ReadLineDouble() => double.Parse(ReadLine());
        public string[] ReadLineSplit() => ReadLine().Split().ToArray();
        public int[] ReadLineSplitInt32() => ReadLine().Split().Select(s => int.Parse(s)).ToArray();
        public long[] ReadLineSplitInt64() => ReadLine().Split().Select(s => long.Parse(s)).ToArray();
        public ulong[] ReadLineSplitUInt64() => ReadLine().Split().Select(s => ulong.Parse(s)).ToArray();
        public double[] ReadLineSplitDouble() => ReadLine().Split().Select(s => double.Parse(s)).ToArray();

        public IEnumerable<string> RepeatReadLines(int count)
        {
            for (int i = 0; i < count; i++)
                yield return ReadLine();
        }
        public IEnumerable<int> RepeatReadLinesInt32(int count)
        {
            for (int i = 0; i < count; i++)
                yield return ReadLineInt32();
        }
        public IEnumerable<long> RepeatReadLinesInt64(int count)
        {
            for (int i = 0; i < count; i++)
                yield return ReadLineInt64();
        }
        public IEnumerable<string[]> RepeatReadLinesSplit(int count)
        {
            for (int i = 0; i < count; i++)
                yield return ReadLineSplit();
        }
    }
    static class DicExt
    {
        public static V GetOrDefault<K, V>(this Dictionary<K, V> dic, K key, V defaultValue = default(V))
        {
            V val;
            return dic.TryGetValue(key, out val) ? val : defaultValue;
        }
    }
}
