#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, ac, wa, tle, re;
  scanf("%d", &n);
  char s[10001];
  int l = strlen(s);
  ac = wa = tle = re = 0;
  for (i = 0; i < n; i++) {
    scanf("%s", s);
    if (strcmp(s, "AC") == 0)
      ac++;
    else if (strcmp(s, "WA") == 0)
      wa++;
    else if (strcmp(s, "RE") == 0)
      re++;
    else {
      tle++;
    }
  }
  printf("AC * %d\n", ac);
  printf("WA * %d\n", wa);
  printf("TLE * %d\n", tle);
  printf("RE * %d\n", re);
}
