#include <bits/stdc++.h>
int main(void) {
  int n, ac = 0, wa = 0, tel = 0, re = 0, i, j;
  char s[100000][4];
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%s", s[i]);
  for (i = 0; i < n; i++) {
    if (s[i][0] == 'A')
      ac++;
    else if (s[i][0] == 'W')
      wa++;
    else if (s[i][0] == 'T')
      tel++;
    else if (s[i][0] == 'R')
      re++;
  }
  printf("AC x %d\n", ac);
  printf("WA x %d\n", wa);
  printf("TEL x %d\n", tel);
  printf("RE x %d\n", re);
  return 0;
}
