#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ac, wa, lte, re;
  cin >> n;
  string S;
  ac = 0;
  wa = 0;
  lte = 0;
  re = 0;
  for (int i = 0; i < n; i++) {
    cin >> S;
    if (S == "AC") {
      ac++;
      continue;
    }
    if (S == "WA") {
      wa++;
      continue;
    }
    if (S == "LTE") {
      lte++;
      continue;
    }
    if (S == "RE") {
      re++;
      continue;
    }
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "LTE x " << lte << endl;
  cout << "RE x " << re << endl;
}
