#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  int a = 0, w = 0, t = 0, r = 0;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC") a++;
    if (s == "WA") w++;
    if (s == "TLE") t++;
    if (s == "RE") r++;
  }
  cout << "AC * " << a << '\n';
  cout << "WA * " << w << '\n';
  cout << "TLE * " << t << '\n';
  cout << "RE * " << r << '\n';
  return 0;
}
