#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a, b, c, d;
  a = b = c = d = 0;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC") a++;
    if (s == "WA") b++;
    if (s == "TLE") c++;
    if (s == "RE") d++;
  }
  printf("AC * %d\nWA * %d\nTLE * %d\nRE * %d\n", a, b, c, d);
}
