#include<iostream>
#include<vector>
#include<string>

int main(void)
{
  int N;
  std::cin >> N;
  
  std::vector<std::string> strList;
  std::string str;
  for(int i=0; i<N;i++)
  {
    std::cin >> str;
    strList.push_back(str);
  }
  
  int counta[4] = {0,0,0,0};
  
  for(int i=0; i<N;i++)
  {
    if(strList[i] == "AC")
    {
      counta[0]++;
    }
    
    if(strList[i] == "WA")
    {
      counta[1]++;
    }

        if(strList[i] == "LTE")
    {
      counta[2]++;
    }

        if(strList[i] == "RE")
    {
      counta[3]++;
    }

  }
  
  
  std::cout << "AC x " <<counta[0]<<endl;
  std::cout << "WA x " <<counta[1]<<endl;
  std::cout << "LTE x " <<counta[2]<<endl;
  std::cout << "RE x " <<counta[3]<<endl;
  return 0;
}