#include <bits/stdc++.h>
using namespace std;
struct fastio {
  fastio() {
    ios::sync_with_stdio(false);
    cout << setprecision(10) << fixed;
    cin.tie(0);
  }
};
fastio _fast_io;
int n;
string s;
unordered_map<string, int> mp;
int main() {
  mp["AC"] = 0;
  mp["WA"] = 0;
  mp["TLE"] = 0;
  mp["RE"] = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    ++mp[s];
  }
  cout << mp["AC"] << endl;
  cout << mp["WA"] << endl;
  cout << mp["TLE"] << endl;
  cout << mp["RE"] << endl;
  return 0;
}
