#include <stdio.h>

int main(void){
  int N, ac=0, wa=0, tle=0, re=0;
  char ans;
  scanf("%d",N);
  
  while(N--){
    scanf("%s",&ans);
    if("AC" == ans) ac++;
    if("WA" == ans) wa++;
    if("TLE" == ans) tle++;
    if("RE" == ans) re++;
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d",ac, wa, tle, re);
}