#include <bits/stdc++.h>
int main(void) {
  char ac = 'A';
  char wa = 'W';
  char tle = 'T';
  char re = 'R';
  char buf[10000];
  int n;
  fgets(buf, sizeof(buf), stdin);
  sscanf(buf, "%d", &n);
  printf("%d\n", n);
  char text[n][10];
  for (int i = 0; i < n; i++) {
    scanf("%s", text[i]);
  }
  int ac1 = 0;
  int wa1 = 0;
  int tle1 = 0;
  int re1 = 0;
  for (int i = 0; i < n; i++) {
    if (text[i][0] == ac) {
      ac1++;
    } else if (text[i][0] == wa) {
      wa1++;
    } else if (text[i][0] == tle) {
      tle1++;
    } else {
      re1++;
    }
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", ac1, wa1, tle1, re1);
}
