function Main(input) {
	const M = +input[0][1];
	const psets = input.slice(1);
   
	const accepted = new Set();
	const penas = {};
	var totalPenas = 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 {
		totalPenas++
	  }
	}
   
	const answer = '' + accepted.size + ' ' + totalPenas;
   
	console.log(answer);
  }

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