using System;
using System.Linq;

namespace AtCoderMake.ABC173
{
    class ABC173B
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            int ac = 0;
            int wa = 0;
            int lte = 0;
            int re = 0;
            
            for(int i = 0; i < n; i++)
            {
                string s = Console.ReadLine();
                if (s == "AC")
                {
                    ac++;
                }
                else if(s=="WA")
                {
                    wa++;
                }
                else if (s == "LTE")
                {
                    lte++;
                }
                else
                {
                    re++;
                }
            }
            Console.WriteLine("AC x " + ac);
            Console.WriteLine("WA x " + wa);
            Console.WriteLine("LTE x " + lte);
            Console.WriteLine("RE x " + re);
        }
    }
}
