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 done = {};
var pena = {}
for (var i = 1; i < input.length; i++) {
    var p = Number(input[i][0]);
    var S = input[i][1];
    if (!done[p] && S == 'AC') {
        done[p] = true;
        cp++;
        pp += pena[p] ? pena[p] : 0;
    } else if(!done[p] && S == 'WA') {
        if (!pena[p]) {
            pena[p] = 0;
        }
        pena[p]++;
    }
}
console.log(cp+' '+pp);