#include <bits/stdc++.h>
using namespace std;
long long powerof(long long x, long long n) {
  long long ans = 0;
  while (x != 0) {
    if (x % n == 0) {
      x /= n;
      ans++;
    } else {
      return ans;
    }
  }
}
signed main() {
  long long test = 1;
  while (test--) {
    long long n;
    cin >> n;
    string s[n];
    for (long long i = 0; i < n; i++) cin >> s[i];
    long long arr[4] = {0};
    for (long long i = 0; i < n; i++) {
      if (s[i] == "AC") arr[0]++;
      if (s[i] == "WA") arr[1]++;
      if (s[i] == "TLE") arr[2]++;
      if (s[i] == "RE") arr[3]++;
    }
    cout << "AC * " << arr[0] << "\nWA * " << arr[1] << "\nTLE * " << arr[2]
         << "\nRE * " << arr[3] << endl;
  }
  return 0;
}
