n = int(input())
a=b=c=d=0
for i in range(n):
  e = input()
  if e == 'AC':
    a+=1
  elif e == 'WA':
    b +=1
  elif e == 'TLE':
    c+=1
  else:
    d+=1

print('AC × '+str(a)+'\n'+'WA × ' +str(b) + '\n'
      +'TLE × '+str(c) +'\n' + 'RE × '+str(d))