n = int(input())
s = [input() for i in range(n)]

a = s.count("AC")
w = s.count("WA")
t = s.count("TLE")
r = s.count("RE")

print(f'AC × {a}')
print(f'WA × {w}')
print(f'TLE × {t}')
print(f'RE × {r}')
