#include <bits/stdc++.h>
using namespace std;
#define input(d) cin >> d
#define inputs(n,d) for(auto i=0;i<n;i++)cin >> d[i]
#define output(d) cout << d << endl
#define outputs(n,d) for(auto i=0;i<n;i++)cout<<d[i]<<endl
typedef f0(n) for(auto i=0;i<n;i++)
typedef f(a,b) for(auto i=a;i<b;i++)

int main(){
  long n,d[4]={0,0,0,0};
  string s;
  input(n);
  f0(n){
    input(s);
    switch(s){
      case "AC": d[0]++;
      case "WA": d[1]++;
      case "TLE": d[2]++;
      case "RE": d[3]++;
    }
  }
  cout << "AC x "<<d[0]<<"WA x "<<d[1]<<"TLE x "<<d[2]<<"RE x "<<d[3]<<endl;
}