#include <bits/stdc++.h>
using namespace std;
int main() {
  int test;
  string s;
  int count_ac = 0, count_wa = 0, count_tle = 0, count_re = 0;
  cin >> test;
  while (test--) {
    cin >> s;
    if (s == "AC") {
      count_ac++;
    } else if (s == "WA") {
      count_wa++;
    } else if (s == "TLE") {
      count_tle++;
    } else if (s == "RE") {
      count_re++;
    }
  }
  cout << "AC * " << count_ac << endl;
  cout << "WA * " << count_wa << endl;
  cout << "TLE * " << count_tle << endl;
  cout << "RE * " << count_re << endl;
  return 0;
}
