#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ac, wa, tle, re;
  ac = wa = tle = re = 0;
  while (n--) {
    string ver;
    cin >> ver;
    if (ver.compare("AC") == 0)
      ac++;
    else if (ver.compare("WA") == 0)
      wa++;
    else if (ver.compare("TLE") == 0)
      tle++;
    else if (ver.compare("RE") == 0)
      re++;
  }
  printf("AC * %d\n", ac);
  printf("WA * %d\n", wa);
  printf("TLE * %d\n", tle);
  printf("RE * %d\n", re);
  return 0;
}
