#include <bits/stdc++.h>
int main(void) {
  int i, n, C0, C1, C2, C3;
  char str[100];
  C0 = C1 = C2 = C3 = 0;
  if (scanf("%d", &n) < 1) exit(1);
  for (i = 0; i < n; i++) {
    if (scanf("%s", str) < 1) {
      exit(1);
    }
    if (strncmp(str, "AC", 2) == 0) {
      C0++;
    } else if (strncmp(str, "WA", 2) == 0) {
      C1++;
    } else if (strncmp(str, "TLE", 3) == 0) {
      C2++;
    } else if (strncmp(str, "RE", 3) == 0) {
      C3++;
    }
  }
  printf("AC * %d\nWA * %d\nTLE * %d\nRE * %d\n", C0, C1, C2, C3);
  return 0;
}
