#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, ac = 0, wa = 0, tle = 0, re = 0;
  cin >> n;
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC") ac++;
    if (s == "WA") wa++;
    if (s == "TLE") tle++;
    if (s == "RE") re++;
  }
  cout << "AC * " << ac << endl;
  cout << "WA * " << wa << endl;
  cout << "TLE * " << tle << endl;
  cout << "RE * " << re << endl;
}
