#include <bits/stdc++.h>
int main(void) {
  unsigned long n = 0;
  int ac = 0, wa = 0, tle = 0, re = 0;
  char s[3];
  scanf("%lu", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    if (s[0] == 'A' && s[1] == 'C') {
      ac++;
    }
    if (s[0] == 'W' && s[1] == 'A') {
      wa++;
    }
    if (s[0] == 'T' && s[1] == 'L' && s[2] == 'E') {
      tle++;
    }
    if (s[0] == 'R' && s[1] == 'E') {
      re++;
    }
    for (int i = 0; i < 3; i++) {
      s[i] = '\0';
    }
  }
  printf("AC × %d\n", ac);
  printf("WA × %d\n", wa);
  printf("TLE × %d\n", tle);
  printf("RE × %d\n", re);
  return 0;
}
