#include <bits/stdc++.h>
int main(void) {
  int N;
  scanf("%d", &N);
  int C0Count = 0, C1Count = 0, C2Count = 0, C3Count = 0;
  char s[5];
  for (int i = 0; i < N; i++) {
    scanf("%s", s);
    if (strcmp(s, "AC") == 0) {
      C0Count++;
    } else if (strcmp(s, "WA") == 0) {
      C1Count++;
    } else if (strcmp(s, "TLE") == 0) {
      C2Count++;
    } else if (strcmp(s, "RE") == 0) {
      C3Count++;
    }
  }
  printf("AC x , %d\n", C0Count);
  printf("WA x , %d\n", C1Count);
  printf("TLE x , %d\n", C2Count);
  printf("RE x ,%d\n", C3Count);
}
