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