#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S[1000000];
  int A = 0, W = 0, T = 0, R = 0;
  for (int i = 0; i < N; i++) {
    cin >> S[i];
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == "AC") {
      A += 1;
    }
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == "WA") {
      W += 1;
    }
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == "TLE") {
      T += 1;
    }
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == "RE") {
      R += 1;
    }
  }
  cout << "AC * " << A;
  cout << "WA * " << W;
  cout << "TLE *" << T;
  cout << "RE *" << R;
  return 0;
}
