#include <bits/stdc++.h>
#pragma warning(disable : 4996)
int main(void) {
  int n;
  char str[100];
  int AC, WA, TLE, RE;
  AC = WA = TLE = RE = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", str);
    if (strcmp(str, "AC") == 0)
      AC++;
    else if (strcmp(str, "WA") == 0)
      WA++;
    else if (strcmp(str, "TLE") == 0)
      TLE++;
    else if (strcmp(str, "RE") == 0)
      RE++;
  }
  printf("\nAC * %d\nWA * %d\nTLE * %d\nRE * %d", AC, WA, TLE, RE);
}
