a = int(input())
jud = []
for i in range(a):
	jud.append(input().strip())
print(a)
print('AC x '+str(jud.count('AC')))
print('WA x '+str(jud.count('WA')))
print('TLE x '+str(jud.count('TLE')))
print('RE x '+str(jud.count('RE')))