var input = require('fs').readFileSync('/dev/stdin', 'utf8');
input = input.split('\n').map(line => line.split(' '));

const N = Number(input[0][0]);
const M = Number(input[0][1]);

var cp = 0;
var pp = 0;
var results = {};
for (var i = 1; i < input.length; i++) {
    var p = Number(input[i][0]);
    var S = input[i][1];
    if (N < p) {
        continue;
    }
    if (!results[p] && S == 'AC') {
        results[p] = true;
        cp++;
    } else if(!results[p] && S == 'WA') {
        pp++;
    }
}
console.log(cp+' '+pp);