#include<stdio.h>
#include<string.h>
int main(void){
  int i,n,a=0,b=0,c=0,d=0;
  char s[100001];
  scanf("%d", &n);
  for(i=0;i<n;i++){
    scanf("%s", &s[i]);
    if(strcmp(s[i],"AC")==0){
      a++;
    }
    else if(strcmp(s[i],"WA")==0){
      b++;
    }
    else if(strcmp(s[i],"TLE")==0){
      c++;
    }
    else(strcmp(s[i],"RE")==0){
      d++;
    }
  }
  printf("AC * %d", a);
  printf("WA * %d", b);
  printf("TLE * %d", c);
  printf("RE * %d", d);
  return 0;
}