#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, i, AC = 0, TLE = 0, RE = 0, WA = 0;
  cin >> n;
  string s[n];
  for (i = 0; i < n; i++) {
    cin >> s[i];
  }
  for (i = 0; i < n; i++) {
    if (s[i] == "WA") {
      WA++;
    } else if (s[i] == "TLE") {
      TLE++;
    } else if (s[i] == "RE") {
      RE++;
    } else if (s[i] == "AC") {
      AC++;
    }
  }
  cout << "AC * " << AC << endl
       << "WA * " << WA << endl
       << "TLE * " << TLE << endl
       << "RE * " << RE << endl;
  return 0;
}
