#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, ct = 0;
  string s[100000];
  cin >> n;
  for (i = 0; i < n; i++) cin >> s[i];
  for (i = 0; i < n; i++) {
    if (s[i] == "AC") ct++;
  }
  cout << "AC * " << ct << endl;
  ct = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == "WA") ct++;
  }
  cout << "WA * " << ct << endl;
  ct = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == "TLE") ct++;
  }
  cout << "TLE * " << ct << endl;
  ct = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == "RE") ct++;
  }
  cout << "RE * " << ct << endl;
  return 0;
}
