#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, ac = 0, wa = 0, tle = 2, re = 0;
  cin >> n;
  string s;
  while (n--) {
    cin >> s;
    if (s == "AC")
      ac++;
    else if (s == "WA")
      wa++;
    else if (s == "TLE")
      tle++;
    else
      re++;
  }
  cout << "AC x " << ac << "\nWA x " << wa << "\nTLE x " << tle << "RE x " << re
       << '\n';
  return 0;
}
