#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int* p;
  string* s;
  p = new int[m];
  s = new string[m];
  int i;
  for (i = 0; i < m; i++) {
    cin >> p[i] >> s[i];
  }
  int ac = 0;
  int wa = 0;
  int f;
  for (i = 0;; i++) {
    if (p[i] == n && s[i] == "WA" ||
        s[i] == "AC" && s[i - 1] == "AC" && p[i] == p[i - 1]) {
      for (f = 0; f < i; f++) {
        if (p[i] == p[f] && s[f] == "AC") {
          break;
        }
      }
    } else if (m == 0) {
      break;
    } else if (s[i] == "AC") {
      ac++;
    } else if (s[i] == "WA") {
      wa++;
    }
  }
  cout << ac << endl << wa;
}
