n = int(input())
s = list(input().split())
a=[]
w=[]
t=[]
r=[]

for i in range (n):
  if s[i] == "AC":
    a.append(s[i])
  elif s[i]== "WA":
    w.append(s[i])
  elif s[i]== "TLE":
    t.append(s[i])
  else:
    r.append(s[i])
  
print("AC × ",sum(a))
print("WA × ",sum(w))
print("TLE × ",sum(t))
print("RE × ",sum(r))
  