list = []
N = int(input())
list = [input() for i in range(N)]
print(list)
print("AC x " +  str(list.count('AC')))
print("WA x  " +  str(list.count("WA")))
print("TLE x  " +  str(list.count("TLE")))
print("RE x  " +  str(list.count("RE")))