function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0].split(" ")[0]);
  var M = parseInt(input[0].split(" ")[1]);
  input.shift();
  input.splice(M,input.length);
  var p = input.map(i => i.split(" "));
  p.sort(function(a,b){return a[0]-b[0]});
  var ac=0;
  var wa=0;
  var wasub=0;
  var q=0;
  var flag=0;
  for(var i = 0;i<M;i++){
    if(flag==0){
      q=p[i][0];
      if(p[i][1]=="WA"){
        wasub++;
      }else{
        wa+=wasub;
        ac++;
        flag=1;
      }
    }else{
      if(p[i][0]!=q){
        q=p[i][0];
        wasub=0;
        if(p[i][1]=="WA"){
          wasub++;
          flag=0;
        }else{
          wa+=wasub;
          ac++;
          flag=1;
        }
      }
    }
  }
  var ans = ac + " " + wa;
  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"));