N = int(input())
Ss = [str(input()) for x in range(N)]
r = [0]*4
for s in Ss:
  if s == "AC":
    r[0] += 1
  elif s == "WA":
    r[1] += 1
  elif s == "TLE":
    r[2] += 1
  elif s == "RE":
    r[3] += 1
print("AC × " + str(r[0]))
print("WA × " + str(r[1]))
print("TLE × " + str(r[2]))
print("RE × " + str(r[3]))
