#include <bits/stdc++.h>
int main(void) {
  int n;
  scanf("%d", &n);
  int ac = 0, wa = 0, tle = 0, re = 0;
  for (int i = 0; i < n; i++) {
    char s[4];
    scanf("%s", s);
    if (strcmp(s, "AC") == 0) {
      ac++;
    }
    if (strcmp(s, "WA") == 0) {
      wa++;
    }
    if (strcmp(s, "TLE") == 0) {
      tle++;
    }
    if (strcmp(s, "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;
}
