n = int(input())

countA = 0
countW = 0
countT = 0
countR = 0
for i in range(n):
  a = input()
  if a == "AC":
    countA += 1
  elif a == "WA":
    countW += 1
  elif a == "TLE":
    countT += 1
  elif a == "RE":
    countR += 1

print("AC × " + str(countA))
print("WA × " + str(countW))
print("TLE × " + str(countT))
print("RE × " + str(countR))
    