n = int(input());

s = [input() for i in range(n)]

ac = wa = tle = re = 0

for s_kind in s:
    if s_kind == "AC":
        ac += 1
    elif s_kind == "WA":
        wa += 1
    elif s_kind == "TLE":
        tle += 1
    elif s_kind == "RE":
        re += 1
    
print(ac)
print(wa)
print(tle)
print(re)