"use strict"
function Main(input) {
  input = input.trim().split('\n');
  const N = input[0].trim().split(' ').map(Number)[0];
  const M = input[0].trim().split(' ').map(Number)[1];
  const P = input.slice(1, M+1);
  
  let ac = 0;
  let wa = 0;
  let tmp = 0;
  for(let i=0; i<M; i++){
    let p = P[i].trim().split(' ')[0];
    let S = P[i].trim().split(' ')[1];
    if(tmp == p) continue;

    if(S == 'WA') {
      wa += 1;
    } else {
      ac += 1;
      tmp = p;
    }
  }
  console.log(ac, wa);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));