#include <bits/stdc++.h>
using namespace std;
int const nax = 3e5 + 10;
int n, m, v, ct, pe;
char s[3];
bool ac[nax];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d %s", &v, s);
    if (s[0] == 'A') {
      if (!ac[v]) {
        ac[v] = true;
        ++ct;
      }
    } else {
      if (!ac[v]) {
        ++pe;
      }
    }
  }
  printf("%d %d\n", ct, pe);
}
