#include <bits/stdc++.h>
using namespace std;

int main() {
  
  int N;
  int i;
    int X1=0;
    int X2=0;
    int X3=0;
    int X4=0;
  cin >> N;

  for(int i=0; i<N+1 ;i++){
    string x;
    cin >> x;
    
    if ( x == "AC"){
      X1++;
    }
    if ( x == "WA"){
      X2++;
    }
    if ( x == "TLE"){
      X3++;
    }
    if ( x == "RE"){
      X4++;
    }

    
  }
  
  
  cout << "AC*"<< X1 << endl;
  cout << "WA*" << X2 << endl;
  cout << "TLE*" << X3 << endl;
  cout << "RE*" << X4 << endl;
}