#include <bits/stdc++.h>
int main(void) {
  int n, c[4] = {0};
  scanf("%d", &n);
  char s[4][n];
  int i = 0;
scans:
  scanf("%s", &s[i]);
  if (i < n) {
    i++;
    goto scans;
  }
  i = 0;
countjudge:
  if (strcmp(s[i], "AC") == 0)
    c[0]++;
  else if (strcmp(s[i], "WA") == 0)
    c[1]++;
  else if (strcmp(s[i], "TLE") == 0)
    c[2]++;
  else if (strcmp(s[i], "RE") == 0)
    c[3]++;
  i++;
  if (i < n) {
    i++;
    goto countjudge;
  }
  i = 0;
answer:
  printf("%d", c[i]);
  i++;
  if (i < 4) {
    i++;
    goto answer;
  }
  return 0;
}
