#include <stdio.h>
#include <stdbool.h>
#define LENGTH 256


int main(void) {
    char input[LENGTH];
    int N;
    fgets(input, LENGTH-1, stdin);
    sscanf(input, "%d", &N);
    int acCount = 0;
    int waCount = 0;
    int tleCount = 0;
    int reCount = 0;
    
    char input2[LENGTH];
    char test[LENGTH];
    for(int i = 0;i < N;i++){
        fgets(input2, LENGTH-1, stdin);
        sscanf(input2, "%s", &test);
        if(strcmp(test,"AC") == 0){
            acCount++;
        }else if(strcmp(test,"WA") == 0){
            waCount++;
        }else if(strcmp(test,"TLE") == 0){
            tleCount++;
        }
    }
    printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d",acCount,waCount,tleCount,reCount);
    
    return 0;
}
