#include <bits/stdc++.h>
int main(void) {
  int n, c0, c1, c2, c3;
  char str[10];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", str);
    if (str[0] == 'A') {
      c0++;
    }
    if (str[0] == 'W') {
      c1++;
    }
    if (str[0] == 'T') {
      c2++;
    }
    if (str[0] == 'R') {
      c3++;
    }
  }
  printf("AC × %d\nWA × %d\nTLE × %d\nRE × %d\n", c0, c1, c2, c3);
  return 0;
}
