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

  var accepted = 0;
  var penas = 0;

  var j, q, pseti, psetj, ac;
  for (var i = 0; i < M; i++) {
    pseti = psets[i];
    if (!pseti) continue;

    q = pseti[0];
    ac = false;

    if (pseti[1][0] === 'A') {
      accepted++;
      ac = true;
    } else {
      penas++;
    }

    for (j = i + 1; j < M; j++) {
      psetj = psets[j];
      if (!psetj || psetj[0] !== q) continue;

      psets[j] = null;
      if (ac) continue;

      if (psetj[1][0] === 'A') {
        accepted++;
        ac = true;
      } else {
        penas++;
      }
    }
  }

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

  console.log(answer);
}

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