#include <bits/stdc++.h>
int main(void) {
  int i, n, ac_count, wa_count, tle_count, re_count;
  char str[4];
  ac_count = wa_count = tle_count = re_count = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%s", str);
    if (str[0] == 'A') {
      ac_count++;
    } else if (str[0] == 'W') {
      wa_count++;
    } else if (str[0] = 'T') {
      tle_count++;
    } else if (str[0] = 'R') {
      re_count++;
    }
  }
  printf("AC * %d\nWA * %d\nTLE * %d\nRE * %d\n", ac_count, wa_count, tle_count,
         re_count);
  return 0;
}
