#include <bits/stdc++.h>
int main() {
  char s[4];
  int n, i, c0 = 0, c1 = 0, c2 = 0, c3 = 0;
  scanf("%d", &n);
  while (n--) {
    scanf("%s", s);
    if (s[0] == 'A')
      c0++;
    else if (s[0] == 'W')
      c1++;
    else if (s[0] == 'T')
      c2++;
    else
      c3++;
  }
  printf("AC * %d\nWA * %d\nTLE * %d\nRE * %d\n", c0, c1, c2, c3);
}
