using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;
using static AtCoderTemplate.MyLibrary;

namespace AtCoderTemplate
{
    class Program
    {
        static void Main (string[] args)
        {
            string str;
            str = Console.ReadLine ();

            int N = int.Parse (str);

            Console.WriteLine (N);

            int ac = 0;
            int wa = 0;
            int tle = 0;
            int re = 0;

            for (int i = 0; i < N; i++)
            {
                string S = Console.ReadLine ();
                switch (S)
                {
                    case "AC":
                        ac += 1;
                        break;
                    case "WA":
                        wa += 1;
                        break;
                    case "TLE":
                        tle += 1;
                        break;
                    case "RE":
                        re += 1;
                        break;
                }
            }

            Console.WriteLine ("AC x " + ac);
            Console.WriteLine ("WA x " + wa);
            Console.WriteLine ("TLE x " + tle);
            Console.WriteLine ("RE x " + re);
        }
    }

    class MyLibrary
    {
        public static int GCD (int a, int b)
        {
            if (a % b == 0) return b;
            return GCD (b, a % b);
        }
    }
}