#include <stdio.h>

int main(void){
  int N, ac=0, wa=0, tle=0, re=0;
  char ans[3];
  scanf("%d",&N);
  
  while(N--){
    scanf("%s",&ans);
    if("A" == ans[0]) ac++;
    if("W" == ans[0]) wa++;
    if("T" == ans[0]) tle++;
    if("R" == ans[0]) re++;
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d",ac, wa, tle, re);
}