#include <bits/stdc++.h>
using namespace std;
int main() {
  int N = 0;
  int AC = 0;
  int WA = 0;
  int TLE = 0;
  int RE = 0;
  cin >> N;
  string S;
  for (int i = 0; i < N; i++) {
    cin >> S;
    if (S.compare("AC") == 0) {
      AC++;
    } else if (S.compare("WA") == 0) {
      WA++;
    } else if (S.compare("TLE")) {
      TLE++;
    } else if (S.compare("RE")) {
      RE++;
    }
  }
  cout << "AC = " << AC << endl;
  cout << "WA = " << WA << endl;
  cout << "TLE = " << TLE << endl;
  cout << "RE = " << RE << endl;
  return 0;
}
