#include <bits/stdc++.h>
int main(void) {
  int i, num, size;
  int count1, count2, count3, count4;
  char str[4];
  count1 = count2 = count3 = count4 = 0;
  scanf("%d", &num);
  for (i = 0; i < num; i++) {
    scanf("%s", str);
    size = strlen(str);
    if (str[0] == 'A' && str[1] == 'C' && size == 2) {
      count1++;
    } else if (str[0] == 'W' && str[1] == 'A' && size == 2) {
      count2++;
    } else if (str[0] == 'T' && str[1] == 'L' && str[2] == 'E' && size == 3) {
      count3++;
    } else if (str[0] == 'R' && str[1] == 'E' && size == 2) {
      count4++;
    }
  }
  printf("AC × %d\n", count1);
  printf("WA × %d\n", count2);
  printf("TLE × %d\n", count3);
  printf("RE × %d\n", count4);
  return 0;
}
