na=0
nw=0
nt=0
nr=0
i = int(input())
for n in range(i):
    a=input()
    if a=="AC":
        na= na +1
    elif a=="WA":
        nw= nw+1
    elif a=="TLE":
        nt=nt+1
    else:
        nr=nr+1
print('AC × %d'%na)
print('WA × %d'%nw)
print('TLE × %d'%nt)
print('RE × %d'%nr)