#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ac = 0, wa = 0, tle = 0, re = 0;
  cin >> n;
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC") {
      ac++;
    } else if (s == "WA") {
      wa++;
    } else if (s == "tle") {
      tle++;
    } else {
      re++;
    }
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", ac, wa, tle, re);
  return 0;
}
