
local N = tonumber(io.read("*line"))
local judge = {}

for i = 1, N do
    local line = io.read("*line")
    judge[#judge + 1] = line
end

local count = {
    AC = 0,
    WA = 0,
    TLE = 0,
    RE = 0
}

for _, result in ipairs(judge) do
    count[result] = count[result] + 1
end

print("AC x ", count.AC)
print("WA x ", count.WA)
print("TLE x ", count.TLE)
print("RE x ", count.RE)
