#include <bits/stdc++.h>
using namespace std;
int main() {
  long n;
  cin >> n;
  long result[] = {0, 0, 0, 0};
  for (long i = 0; i < n; i++) {
    string tmp;
    cin >> tmp;
    if (tmp == "AC") {
      result[0]++;
    } else if (tmp == "WA") {
      result[1]++;
    } else if (tmp == "TLE") {
      result[2]++;
    } else if (tmp == "RE") {
      result[3]++;
    }
  }
  cout << "AC × " << result[0] << endl;
  cout << "WA × " << result[1] << endl;
  cout << "TLE × " << result[2] << endl;
  cout << "RE × " << result[3] << endl;
}
