"use strict";
function I(s,f){this._s=s.split("\n");this._c=0;this._l=0;this._f=f||Number}I.prototype.a=function(){var l=this._s[this._l];if(!l)return;var t=l.trim().split(" ");var a=t[this._c];this._c++;if(t.length===this._c){this._c=0;this._l++}return this._f(a)};I.prototype.l=function(){var l=this._s[this._l];if(!l)return;this._c=0;this._l++;return l.split(" ").map(this._f)};

function main(input) {
  const o = new I(input, String);

  const N = Number(o.a());
  const Q = Number(o.a());
  const s = o.a();
  const t = [];
  const d = [];

  for (let i=0; i<Q;i++) {
    t.push(o.a());
    d.push(o.a());
  }

  let map = {};
  s.split("").forEach((c, index) => {
    if (!map[c]) {
      map[c] = [index];
    } else {
      map[c].push(index);
    }
  })

  const result = Array(N).fill(1);
  for(let i = 0; i < Q; i++) {
    if(map[t[i]]) {
      map[t[i]].forEach(index => {
        if (d[i] ==="L") {
          if (result[index] !== 0) {
            if (result[index - 1] !== undefined) {
              result[index - 1] += result[index];
            }
            result[index] = 0;
          }
        } else {
          if (result[index] !== 0) {
            if (result[index + 1] !== undefined) {
              result[index + 1] += result[index];
            }
            result[index] = 0;
          }
        }
      })
    }
  }
  console.log(result.reduce((acc, cur) => acc + cur));

}


main(require("fs").readFileSync("/dev/stdin", "utf8"));
