n=int(input())
ac, wa, tle, re=0, 0, 0, 0
for i in range(n):
  str=input(str())
  if str=='AC':
    ac++
  elif str=='WA':
    wa++
  elif str=='TLE':
    tle++
  elif str=='RE':
    re++

print('AC x ', ac)
print('WA x ', wa)
print('TLE x ', tle)
print('RE x ', re)