#include <bits/stdc++.h>
using namespace std;
int AC = 0, WA = 0, TLE = 0, RE = 0;
int main() {
  int tt;
  string verd;
  cin >> tt;
  while (tt--) {
    cin >> verd;
    if (verd == "AC") AC++;
    if (verd == "WA") WA++;
    if (verd == "TLE") TLE++;
    if (verd == "RE") RE++;
  }
  cout << "AC * " << AC << endl;
  cout << "WA * " << WA << endl;
  cout << "TLE * " << TLE << endl;
  cout << "RE * " << RE << endl;
}
