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