n = int(input())
s = [input() for i in range(n)]
 
i = 0
a = 0
t = 0
w = 0
r = 0
 
for i in range(n):
  if s[i] == "AC":
    a += 1
    i += 1
  elif s[i] == "TLE":
    t += 1
    i += 1
  elif s[i] == "WA":
    w += 1
    i += 1
  else:
    r += 1
    i += 1
 
print("""AC × {0}
WA × {1}
TLE × {2}
RE × {3}""". format(a, w, t, r))