#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  int c = 0, c1 = 0, c2 = 0, c3 = 0;
  cin >> t;
  while (t--) {
    string str;
    cin >> str;
    if (str.length() == 2) {
      if (str[0] == 'A')
        c++;
      else if (str[0] == 'R')
        c1++;
      else if (str[0] == 'W')
        c2++;
      else
        break;
    } else
      c3++;
  }
  cout << "AC * " << c;
  cout << "\nWA * " << c2;
  cout << "\nTLE * " << c3;
  cout << "\nRE * " << c1;
  return 0;
}
