#include <bits/stdc++.h>
using namespace std;
const int M = 998244353;
const int MAX = (2e5) + 10;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int n, ac, wa, tle, re;
string str;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> str;
    ac += (str == "AC");
    wa += (str == "WA");
    tle += (str == "TLE");
    re += (str == "RE");
  }
  cout << "AC * " << ac << endl;
  cout << "WA * " << wa << endl;
  cout << "TLE * " << tle << endl;
  cout << "RE * " << re << endl;
  return 0;
}
