#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  string s;
  map<string, long long> mp;
  while (n--) {
    cin >> s;
    mp[s]++;
  }
  cout << mp["AC"] << "\n"
       << mp["WA"] << "\n"
       << mp["TLE"] << "\n"
       << mp["RE"] << "\n";
  return 0;
}
