
function binarySearch ( list, num ) {
  var index = -1;
  var head = 0;
  var tail = list.length;

  while( head <= tail ) {
    var center = Math.floor(( head + tail ) / 2);
    var centerVal = list[center];

    if( centerVal === num ) {
      index = center;
      break;
    }
    if( centerVal < num ) {
      head = center + 1;
    }else {
      tail = center - 1;
    }
  }
  return index;
}


function Main(arg)
{
  var tmp = arg.split("\n");
  var N = tmp[0].split(" ")[0] -0;
  var M = tmp[0].split(" ")[1] -0;
  var p = tmp.slice(1).map(v => v.split(" ")[0]);
  var s = tmp.slice(1).map(v => v.split(" ")[1]);
    
  var ans = 0;
  var pena = 0;
  var list = [];

  for (var i = 0; i < M; i++)
  {
    
    if (binarySearch(list, p[i]) !== -1) continue;

    if (s[i] === "AC")
    {
      ans++;
      list.push(p[i]);
    }
    else if (s[i] === "WA")
    {
      pena++;
    }
  }

  console.log(ans + " " + pena);

  return;
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
