#include <bits/stdc++.h>
int main() {
  int a, b, c, i, d, e, n;
  char s[100];
  scanf("%d", &e);
  {
    for (n = 0; n < e; n++) {
      scanf("%s", s);
    }
    a = 0;
    i = 0;
    b = 0;
    c = 0;
    d = 0;
  }
  {
    if (s[i] == 'AC') {
      a++;
    } else if (s[i] == 'WA') {
      b++;
    } else if (s[i] == 'RE') {
      d++;
    } else {
      c++;
    }
    i++;
  }
  printf("AC * %d\nWA * %d\nTLE * %d\nRE * %d", a, b, c, d);
  return 0;
}
