n = int(input())

s = []
for _ in range(n):
  s1 = input()
  s.append(s1)

print('AC × ' + str(s.count('AC')))
print('WA × ' + str(s.count('WA')))
print('TLE × ' + str(s.count('TLE')))
print('RE × ' + str(s.count('RE')))