#include <iostream>
using namespace std;
int main(){int t; cin>>t:int a=0,b=0,c=0,d=0;
while(t--){string s; cin>>s;
//int a=0,b=0,c=0,d=0;}
if(s =='AC'){ a++;}
if(s =='WA'){ b++;}
if(s =='TLE'){ c++;}
if(s =='RE'){ d++;}
cout<<(AC * a)<<"\n"<<(WA * b)<<"\n"<<(TLE * c)<<"\n"<<(RE * d);

return 0;}