"use strict";
// import bigInt from 'big-integer'

const Main = input => {
  input = input.trim().split("\n");
  const configs = input.shift().split(" ");
  const problemCount = configs[0];
  const answerCount = configs[1];

  let acCount = 0;
  let waCount = 0;
  const map = new Map();
  for (let i = 0; i < answerCount; i++) {
    const data = input[i].split(" ");
    const nextProblem = parseInt(data[0], 10);
    const nextRw = data[1]; // Right and Wrong

    const prevRw = map.get(nextProblem) || null;

    if (prevRw === null) {
      // 初めて解く問題
      if (nextRw === "AC") {
        acCount++;
        map.set(nextProblem, "AC");
      } else {
        map.set(nextProblem, 1);
      }
    } else if (prevRw !== "AC") {
      // 解答経験がある問題
      if (nextRw === "AC") {
        acCount++;
        waCount += prevRw;
        map.set(nextProblem, "AC");
      } else {
        map.set(nextProblem, prevRw + 1);
      }
    }
  }

  console.log(acCount + " " + waCount);
};

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