program bm
implicit none
integer::N,C(4)=0
character::S
integer::i
read*,N
do i=1,N
    read*,S
    select case(S)
    case("A")
        C(1)=C(1)+1
    case("W")
        C(2)=C(2)+1
    case("T")
        C(3)=C(3)+1
    case("R")
        C(4)=C(4)+1
    end select
end do
print'("AC x ",i0)',C(1)
print'("WA x ",i0)',C(2)
print'("TLE x ",i0)',C(3)
print'("RE x ",i0)',C(4)
end program bm