module welcome_to_atcoder;
import std.stdio;
import std.container.rbtree;
import std.algorithm;

void main(string[] args)
{
    int n, m;
    readf("%d %d\n", &n, &m);
    int i;
    string s;
    int[int] penalties;
    auto acs = redBlackTree!int();
    foreach (_; 0 .. m)
    {
        readf("%d %s\n", &i, &s);
        if (s != "AC" && !(i in acs))
        {
            ++penalties[i];
        }
        else
        {
            acs.stableInsert(i);
        }
    }
    writefln("%d %d", acs.length, penalties.byValue.sum);
}
