#include <stdio.h>
#include <stdlib.h>

int main(void)
{
	int i,n,ac_count,wa_count,tle_count,re_count;
	char str[100];

	ac_count = wa_count = tle_count = re_count = 0;
	
	if(scanf("%d",&n)<1)
		exit(1);

	for(i=0;i<n;i++){
		if(scanf("%s",str)<1){
			exit(1);
		}
		if(str == "AC"){
			ac_count++;
		}
		else if(str =="WA"){
			wa_count++;
		}
		else if(str[0]=="TLE"){
			tle_count++;
		}
		else if(str[0]=="RE"){
			re_count++;
		}
	}

	printf("AC * %d\nWA * %d\nTLE * %d\nRE * %d\n",ac_count,wa_count,tle_count,re_count);

	return 0;
}
