function Main(input){
  
  var str = input;
  var tmp = str.split("\n");
   // //console.log(tmp);
  var nq = tmp[0].split(" ");
  var n = nq[0];
  var q = nq[1];
  var s = tmp[1];
              
  var td = tmp.slice(2, q+1);
  var t = [];
  var d = [];
 //console.log(td);
 var s_len = s.length;
  var s_array = s.split("");
  var gl = [];
    //console.log("s_array")
  //console.log(s_array)
  
  for(h=0;h<=s_len-1;h++){//go-remu tukuru
    gl.push(1);
    
  }//go-remu tukuru
  //console.log("gl")
  //console.log(gl)
  
  for(i=0;i<=q-1;i++){
   var tmp_td = td[i].split(" ");
    t.push(tmp_td[0]);
    d.push(tmp_td[1]);
  }//for
  //console.log("t")
  //console.log(t)  
    //console.log("d")
  //console.log(d)  

  for(j=0;j<=q-1;j++){//jumon kaisuu
    
    for(k=0;k<=s_len-1;k++){//s zenbu
      if(s_array[k]==t[j]){//iti moji itti kakunin
      if(d[j]=="L"){//t0 ga Lidou
        if(k==0){
        gl[k]=0;
   //console.log("gl[k]")
  //console.log(gl[k])  
        } else {//else go-remu idou ptL
           gl[k-1] = gl[k-1]+gl[k];
          gl[k]=0;
             //console.log("gl[k]"+k)
    //console.log(gl[k])  
      }//else go-remu idou ptL
        
      }else if(d[j]=="R"){//else go-remu itibanmigi
          if(k==s_len-1){
          gl[k] = 0;} else {//else go-remu idou ptR else if(k<s_len-1) 
   			gl[k+1] = gl[k+1]+gl[k];
             gl[k]=0;}
           }//else go-remu idou ptR else if(k<s_len-1) 

         
     }//if iti moji itti kakunin
 
    }//for s zenbu
   
  
    }//for jumon kaisuu

//youso wa
var sum  = function(arr) {
    return arr.reduce(function(prev, current, i, arr) {
        return prev+current;
    });
};
//console.log( sum(gl) );
//youso wa kokomade
    
}//function
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));