N = int(input())
S = [input() for i in range(N)]
C0 = S.count('AC')
C1 = S.count('WA')
C2 = S.count('TLE')
C3 = S.count('RE')
print('AC × ' + str(C0))
print('WA × ' + str(C1))
print('TLE × ' + str(C2))
print('RE × ' + str(C3))