#include <bits/stdc++.h>
using namespace std;
int main() {
  int x;
  cin >> x;
  int a = 0, w = 0, t = 0, r = 0;
  for (int i = 0; i < x; i++) {
    string n;
    cin >> n;
    if (n == "AC")
      a++;
    else if (n == "WA")
      w++;
    else if (n == "TLE")
      t++;
    else if (n == "RE")
      r++;
  }
  cout << "AC x " << a << endl;
  cout << "WA × " << w << endl;
  cout << "TLE × " << t << endl;
  cout << "RE × " << r << endl;
}
