#include <bits/stdc++.h>
int main(void) {
  int N;
  char S[4];
  int c0 = 0, c1 = 0, c2 = 0, c3 = 0;
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%s", S);
    if (S[0] == 'A' && S[1] == 'C')
      c0++;
    else if (S[0] == 'W' && S[1] == 'A')
      c1++;
    else if (S[0] == 'T' && S[1] == 'L' && S[2] == 'E')
      c2++;
    else if (S[0] == 'R' && S[1] == 'E') {
      c3++;
    }
  }
  printf("AC × %d\n", c0);
  printf("WA × %d\n", c1);
  printf("TLE × %d\n", c2);
  printf("RE × %d\n", c3);
}
