N = input()
n = int(N)

jugde = []
for i in range(n):
  s = input()
  jugde.append(s)
  
print('AC×',jugde.count('AC'))
print('WA×',jugde.count('WA'))
print('TLE×',jugde.count('TLE'))
print('RE×',jugde.count('RE'))