#include<bits/stdc++.h>
using namespace std;
int main()
{
  int t;
  string s;
  cin>>t;
  map<string,int>m;
  while(t--)
  {
    cin>>s;
    m[s]++;
  }
  cout<<m["AC"]<<endl;
  cout<<m["WA"]<<endl;
  cout<<m["TLE"]<<endl;
  cout<<<m["RE"]<<endl;
return 0;
}