

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 alf=new Array(26);
  for(var i=0;i<26;i++){
    alf[i]=[];
  }
  for(var i=0;i<N;i++){
    alf[parseInt(s[i],36)-10].push(i);
  }
  var robo=new Array(N).fill(1);
  for(var i=0;i<Q;i++){
    var cal=parseInt(input[i+2].split(" ")[0],36)-10;
    var lr =input[i+2].split(" ")[1];
    if(lr=="L"){
      for(var j=0;j<alf[cal].length;j++){
        if(alf[cal][j]!=0){
          robo[alf[cal][j]-1]+=robo[alf[cal][j]];
          robo[alf[cal][j]]=0;
        }else{
          robo[alf[cal][j]]=0;
        }
      }
    }else{
      for(var j=0;j<alf[cal].length;j++){
        if(alf[cal][j]!=robo.length-1){
          robo[alf[cal][j]+1]+=robo[alf[cal][j]];
          robo[alf[cal][j]]=0;
        }else{
          robo[alf[cal][j]]=0;
        }
      }
    }
  }
  var ans =0;
  for(var i=0;i<robo.length;i++){
    ans+=robo[i];
  }
  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"));