#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const ll LINF = 1001002003004005006LL;
const int INF = 1001001001;
const int mod = 1000000007;
int main() {
  int n;
  cin >> n;
  map<string, int> mp;
  for (int i = 0; i < (n); ++i) {
    string si;
    cin >> si;
    ++mp[si];
  }
  cout << mp["AC"] << endl;
  cout << mp["WA"] << endl;
  cout << mp["TLE"] << endl;
  cout << mp["RE"] << endl;
  return 0;
}
