#include <bits/stdc++.h>
int main() {
  long n, i, ac = 0, wa = 0, tle = 0, re = 0;
  scanf("%ld", &n);
  char r[5];
  for (i == 0; i < n; i++) {
    scanf("%s", r);
    if (strcmp(r, "AC") == 0) {
      ++ac;
    } else if (strcmp(r, "wa") == 0) {
      ++wa;
    } else if (strcmp(r, "tle") == 0) {
      ++tle;
    } else {
      ++re;
    }
  }
  printf("AC x %ld\nWA x %ld\nTLE x %ld\nRE x %ld\n", ac, wa, tle, re);
}
