using System;

class B
{
	static void Main()
	{
		int c = 0, w = 0, t = 0, r = 0;
		for (int i = 0; i < int.Parse(Console.ReadLine()); i++)
		{
			var b = Console.ReadLine();
			if (b == "AC") c++;
			if (b == "WA") w++;
			if (b == "TLE") t++;
			if (b == "RE") r++;
		}
		Console.WriteLine("AC x " + c + "\n" + "WA x " + w + "\n" + "TLE x " + t + "\n" + "RE x " + r);
	}
}