#include <stdio.h>
#include <string.h>
int main(void){
    int n,c[4]={0};
    scanf("%d",&n);
    int char[4][n];
    int i=0;
    scans:
    scanf("%s",&s[i]);
    if(i<n)goto scans;
    i=0;
    countjudge:
    if(strcmp(s[i],"AC")==0)c[0]++;
    else if(strcmp(s[i],"WA")==0)c[1]++;
    else if(strcmp(s[i],"TLE")==0)c[2]++;
    else if(strcmp(s[i],"RE")==0)c[3]++;
    if(i<n)goto countjudge
    i=0;
    answer:
    printf("%d",c[i]);
    if(i<4)goto answer;
    return 0;
}