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

int main()
{
	int N, i, C0 = 0, C1 = 0, C2 = 0, C3 = 0;
	char *S;

	scanf("%d", &N);
	S = (char*)malloc(N * sizeof(char*));

	for (i = 0; i < N; i++)
	{
		S[i] = (char)malloc(2 * sizeof(char));
	}

	for (i = 0; i < N; i++)
	{
		gets_s(S[i]);
	}

	for (i = 0; i < N; i++)
	{
		if (strcmp("AC", S[i]) == 0)   C0++;
		if (strcmp("WA", S[i]) == 0)  C1++;
		if (strcmp("TLE", S[i]) == 0) C2++;
		if (strcmp("RE", S[i]) == 0)  C3++;
	}

	printf("AC * %d", C0);
	printf("WA * %d", C1);
	printf("TLE * %d", C2);
	printf("RE * %d", C3);

	return 0;
}
