#include <bits/stdc++.h>
using namespace std;
int main() {
  string x;
  int N, count[4] = {0};
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> x;
    if (x == "AC")
      count[0]++;
    else if (x == "WA")
      count[1]++;
    else if (x == "TLE")
      count[2]++;
    else if (x == "RE")
      count[3]++;
  }
  cout << count[0] << endl;
  cout << count[1] << endl;
  cout << count[2] << endl;
  cout << count[3] << endl;
  return 0;
}
