n = int(input())
test = []
for i in range(n):
    test.append(input())
print('AC × ' + str(test.count('AC')))
print('NA × ' + str(test.count('NA')))
print('TLE × ' + str(test.count('TLE')))
print('RE × ' + str(test.count('RE')))