#include <bits/stdc++.h>
char str[5];
int main() {
  int n, a = 0, b = 0, c = 0, d = 0;
  scanf("%d", &n);
  while (n--) {
    scanf("%s", str);
    if (strcmp(str, "AC") == 0) a++;
    if (strcmp(str, "WA") == 0) b++;
    if (strcmp(str, "TLE") == 0) c++;
    if (strcmp(str, "RE") == 0) d++;
  }
  printf("AC * %d\nWA * %d\nTLE * %d\nRE * %d", a, b, c, d);
}
