n = int(input())
Sn = []

for i in range(n):
    Sn.append(input())

ac = Sn.count('AC')
wa = Sn.count('WA')
tle = Sn.count('TLE')
re = Sn.count('RE')

print('AC × {}'.format(ac))
print('WA × {}'.format(wa))
print('TLE × {}'.format(tle))
print('RE × {}'.format(re))