#include <bits/stdc++.h>
int main(void) {
  int N;
  scanf("%d", &N);
  int ac = 0;
  int wa = 0;
  int tle = 0;
  int re = 0;
  char result[3];
  int count = 0;
  while (count <= N) {
    scanf("%s", result);
    count++;
    if (strcmp(result, "AC") == 0) {
      ac++;
    } else if (strcmp(result, "WA") == 0) {
      wa++;
    } else if (strcmp(result, "TLE") == 0) {
      tle++;
    } else if (strcmp(result, "RE") == 0) {
      re++;
    }
  }
  printf("AC x %d\n", ac);
  printf("WA x %d\n", wa);
  printf("TLE x %d\n", tle);
  printf("RE x %d\n", re);
  printf("%d", count);
  return 0;
}
