#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  long long c1 = 0, c2 = 0, c3 = 0, c4 = 0;
  for (long long i = 0; i < t; i++) {
    string s;
    cin >> s;
    if (s == "AC") {
      c1++;
    } else if (s == "WA") {
      c2++;
    } else if (s == "TLE") {
      c3++;
    } else {
      c4++;
    }
  }
  cout << "AC * " << c1 << "\n";
  cout << "WA * " << c2 << "\n";
  cout << "TLE * " << c3 << "\n";
  cout << "RE * " << c4 << "\n";
  return 0;
}
