#include <bits/stdc++.h>
int main() {
  char s[100];
  int a = 0, w = 0, t = 0, r = 0, n;
  scanf("%d", &n);
  while (n--) {
    scanf("%s", s);
    if (s[0] == 'A')
      a++;
    else if (s[0] == 'W')
      w++;
    else if (s[0] == 'T')
      t++;
    else
      r++;
  }
  printf("AC * %d\nWA * %d\nTLE * %d\nRE * %d\n", a, w, t, r);
  return 0;
}
