#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int N;
  int a[4] = {0, 0, 0, 0};
  while (N--) {
    string s;
    cin >> s;
    if (s == "AC")
      ++a[0];
    else if (s == "WA")
      ++a[1];
    else if ("TLE" == s)
      ++a[2];
    else
      ++a[3];
  }
  cout << "AC x " << a[0];
  cout << "\nWA x " << a[1];
  cout << "\nTLE x " << a[2];
  cout << "\nRE x \n" << a[3];
}
