<?php
	$str = explode(' ', fgets(STDIN));
	$ret = $Q = $str[0];
	$N = $str[1];
	$s = fgets(STDIN);
	$wk = [];
	$offset = 1;
	$sizeChange;
	for($i=0;$i<$N; $i++) {
      $td[$i] = explode(' ', fgets(STDIN));
      $t = $td[$i][0];
      $d = $td[$i][1];
      $sizeChange = true;
      if($i === 0) {
      	for($j=0; $j<$Q; $j++) {
          if(!isset($wk[$s[$j]])) {
            $wk[$s[$j]] = array_fill(0, $Q, '');
          }
          $wk[$s[$j]][$j] = $s[$j];
          
        }
        //echo var_dump($wk);
      }
      if(!isset($wk[$t])) continue;
      //echo var_dump($wk[$t]);
      if (strpos($d, "L") !== false) {
        //echo $t.'-- w:'.$wk[$t][0].';';
        if($wk[$t][0] !== "") {
          	//echo '///shift///';
       		//echo var_dump($wk[$t]);
          	array_shift($wk[$t]);
       		//echo var_dump($wk[$t]);
          	$ret = $ret - 1;
            foreach($wk as $key => $value) {
              if($key === $t) continue;
              if($value[count($value) - 1] !== "") {
                $sizeChange = false;
              }
         	}
          	if( $sizeChange === true ) {
            	foreach($wk as $key => $value) {
             		if($key === $t) continue;
                  	array_pop($wk[$key]);
         		}
            }
        }
      }
      else if (strpos($d, "R") !== false) {
        //echo $t.'-- w:'.$wk[$t][count($wk[$t]) - 1].';';
      	if($wk[$t][count($wk[$t]) - 1] !== "") {
         	//echo '///pop///';
       		//echo var_dump($wk[$t]);
          	array_pop($wk[$t]);
       		//echo var_dump($wk[$t]);
          	$ret = $ret - 1;
            foreach($wk as $key => $value) {
              if($key === $t) continue;
              if($value[count($value) - 1] !== "") {
                $sizeChange = false;
              }
         	}
          	if( $sizeChange === true ) {
            	foreach($wk as $key => $value) {
             		if($key === $t) continue;
                  	array_pop($wk[$key]);
         		}
            }
        }

      }
      
    }
	echo $ret;
	

 ?>