/**
 * @param input string[][]
 */
function Main(input) {
  const M = +input[0][1];
  const psets = input.slice(1);

  const accepted = new Set();
  var penas = 0;

  var q;
  for (var i = 0; i < M; i++) {
    q = psets[i][0];

    if (accepted.has(q)) continue;

    if (psets[i][1][0] === 'A') {
      accepted.add(q);
    } else {
      penas++;
    }
  }

  const answer = '' + accepted.size + ' ' + penas;

  console.log(answer);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim()
  .split('\n')
  .map((v) => v.split(' '))
);
