#include<bits/stdc++.h>
#define int long long int
#define pb push_back
#define vec vector<int>
using namespace std;
main()
{
  int t=1;
  //cin>>t;
  while(t--)
  {
    int n,i;
    cin>>n;
    /*vector<int> a(n);
    for(i=0;i<n;i++)
        cin>>a[i];
    */
    string s;
    int ac=0,wa=0,tle=0,re=0;
    for(i=0;i<n;i++)
    {
      cin>>s;
      if(s=="AC")
            ac++;
      else if(s=="TLE")
        tle++;
      else if(s=="RE")
        re++;
      else
        wa++;
    }
    cout<<"AC * "<<ac<<"\nWA * "<<wa<<"\nTLE * "<<tle<<"\nRE * "<<re;
  }
}