using System;
 
namespace workspace{
  class Test{
    static void Main(){
        var ansAC = 0;
        var ansWA = 0;
        var ansTLE = 0;
        var ansRE = 0;
        int N = Int32.Parse(Console.ReadLine());
        for(int i = 0; i < N ; i++){
          var S = Console.ReadLine();
          if(S == "AC"){
            ansAC++;
          }else if(S == "WA"){
            ansWA++;
          }else if(S == "TLE"){
            ansTLE++;
          }else{
            ansRE++;
          }
        }
        Console.WriteLine("AC x ${ansAC}");
        Console.WriteLine("WA x ${ansWA}");
        Console.WriteLine("TLE x ${ansTLE}");
        Console.WriteLine("RE x ${ansRE}");
      }
    }
  }