

function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0].split(" ")[0]);
  var Q = parseInt(input[0].split(" ")[1]);
  var s = input[1].split("");
  var lc=0;
  var rc=s.length-1;
  var r=0;
  var l=0;
  for(var i=Q+1;i>1;i--){
    var c=input[i].split(" ")[0];
    var lr=input[i].split(" ")[1];
    if(lr=="L"&&c==s[lc]){
      l++;
      lc++;
    }else if(lr=="R"&&c==s[rc]){
      r++;
      rc--;
    }
  }
  var ans=N-r-l;
  console.log('%s', ans);
  return ans;
}

function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));