#include <iostream>
#include <map>
#include <set>

using namespace std;

int main() {
  int p, W{};
  set<int> s;
  map<int,int> m;
  string S;
  cin >> p >> p;
  while (cin >> p >> S) {
    if (s.count(p)) continue;
    else if (S=="AC") s.insert(p), W += m[p];
    else ++m[p];
  }
  cout << s.size() << " " << W << endl;
}
