#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, t, ac = 0, wa = 0, tle = 0, re = 0;
  cin >> a;
  for (int i = 0; i < a; i++) {
    cin >> t;
    if (t == 'AC') ac++;
    if (t == 'WA') wa++;
    if (t == 'TLE') tle++;
    if (t == 'RE') re++;
  }
  cout << "AC * " << ac << endl
       << "WA * " << wa << endl
       << "TLE * " << tle << endl
       << "RE * " << re << endl;
  return 0;
}
