#include <bits/stdc++.h>
using namespace std;
enum { AC = 0, WA, TLE, RE };
int main() {
  int caseNum = 0;
  cin >> caseNum;
  vector<string> judgeResult(caseNum);
  vector<int> judgeCnt(4);
  for (int i = 0; i < caseNum; i++) {
    cin >> judgeResult[i];
    if (judgeResult[i] == "AC") judgeCnt[AC]++;
    if (judgeResult[i] == "WA") judgeCnt[WA]++;
    if (judgeResult[i] == "TLE") judgeCnt[TLE]++;
    if (judgeResult[i] == "RE") judgeCnt[RE]++;
  }
  cout << "AC × " << judgeCnt[AC] << endl;
  cout << "WA × " << judgeCnt[WA] << endl;
  cout << "TLE × " << judgeCnt[TLE] << endl;
  cout << "RE × " << judgeCnt[RE] << endl;
  return 0;
}
