#include <bits/stdc++.h>
int main() {
  int test;
  scanf("%d", &test);
  char arr[test];
  int tle = 0, wa = 0, ac = 0, re = 0;
  for (int i = 0; i < test; i++) {
    scanf("%s", arr);
    for (int i = 0; i < test - 1; i++) {
      if (arr[i] == 'A' && arr[i + 1] == 'C') {
        ac++;
      }
      if (arr[i] == 'R' && arr[i + 1] == 'E') {
        re++;
      }
      if (arr[i] == 'W' && arr[i + 1] == 'A') {
        wa++;
      }
      if (arr[i] == 'T' && arr[i + 1] == 'L') {
        tle++;
      }
    }
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n ", ac, wa, tle, re);
}
