#include <bits/stdc++.h>
using namespace std;
using mii = map<int, int>;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
const int mod = 1e9 + 7, mxN = 2e6 + 5;
template <typename... Args>
void print(Args... args) {
  ((cout << args << " "), ...);
  cout << "\n";
}
ll mod_pow(ll x, ll y) {
  ll res = 1;
  x %= mod;
  for (; y > 0; y >>= 1, x = (x * x) % mod)
    if (y & 1) res = (res * x) % mod;
  return res;
}
ll mod_inv(ll n) {
  ll ans = mod_pow(n, mod - 2);
  return ans;
}
ll mul(ll a, ll b) {
  a %= mod, b %= mod;
  return (a * b) % mod;
}
ll sub(ll a, ll b) {
  a %= mod, b %= mod;
  return (a - b + mod) % mod;
}
ll add(ll a, ll b) {
  a %= mod, b %= mod;
  return (a + b) % mod;
}
bool prime(ll n) {
  if (n < 2) return 0;
  if (n < 4) return 1;
  if (n % 2 == 0 || n % 3 == 0) return 0;
  for (ll i = 5; i * i <= n; i += 6)
    if (n % i == 0 || n % (i + 2) == 0) return 0;
  return 1;
}
ll n;
map<string, int> m;
string st;
void solve() {
  cin >> st;
  m[st]++;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  int t;
  for (cin >> t; t--;) solve();
  print(m["AC"], m["WA"], m["TLE"], m["RE"]);
  return 0;
}
