n = int(input())
abc = []
for i in range(n):
    s = str(input())
    abc.append(s)

print('AC × {}'.format(abc.count('AC')))
print('WA × {}'.format(abc.count('WA')))
print('TLE × {}'.format(abc.count('TLE')))
print('RE × {}'.format(abc.count('RE')))