N = int(input())

result = [input().rstrip() for _ in range(N)]
print('AC × '+str(result.count('AC')))
print('WA × '+str(result.count('WA')))
print('TLE × '+str(result.count('TLE')))
print('RE × '+str(result.count('RE')))
