#include <bits/stdc++.h>
int main(void) {
  int N;
  std::cin >> N;
  std::vector<std::string> strList;
  std::string str;
  for (int i = 0; i < N; i++) {
    std::cin >> str;
    strList.push_back(str);
  }
  int counta[4] = {0, 0, 0, 0};
  for (int i = 0; i < N; i++) {
    if (strList[i] == "AC") {
      counta[0]++;
    }
    if (strList[i] == "WA") {
      counta[1]++;
    }
    if (strList[i] == "LTE") {
      counta[2]++;
    }
    if (strList[i] == "RE") {
      counta[3]++;
    }
  }
  std::cout << "AC x " << counta[0] << "\n";
  std::cout << "WA x " << counta[1] << "\n";
  std::cout << "LTE x " << counta[2] << "\n";
  std::cout << "RE x " << counta[3] << "\n";
  return 0;
}
