#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char *argv[]) {
  int n;
  cin >> n;
  vector<string> vs(n);
  for (int i = 0; i < n; ++i) {
    cin >> vs[i];
  }
  int ac, wa, tle, re;
  ac = wa = tle = re = 0;
  for (auto &s : vs) {
    if (s == "AC") {
      ac++;
    } else if (s == "WA") {
      wa++;
    } else if (s == "TLE") {
      tle++;
    } else {
      re++;
    }
  }
  cout << ac << '\n';
  cout << wa << '\n';
  cout << tle << '\n';
  cout << re << '\n';
  return 0;
}
