int main(void) {
	int n;
	char str[100];
	int AC = 0, WA = 0, TLE = 0, RE = 0;

	scanf("%d", &n);

	for (int i = 0; i < n;i++) {
		scanf("%s",str);

		if (str == "AC")
			AC++;
		else if (str == "WA")
			WA++;
		else if (str == "TLE")
			TLE++;
		else if (str == "RE")
			RE++;
	}

	printf("\nAC * %d\nWA * %d\nTLE * %d\nRE * %d",AC,WA,TLE,RE);

}
