#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long count1 = 0, count2 = 0, count3 = 0, count4 = 0;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC") {
      count1++;
    } else if (s == "WA") {
      count2++;
    } else if (s == "TLE") {
      count3++;
    } else if (s == "RE") {
      count4++;
    }
  }
  cout << "AC * " << count1 << endl;
  cout << "WA * " << count2 << endl;
  cout << "TLE * " << count3 << endl;
  cout << "RE * " << count4 << endl;
}
