import Control.Monad
calc [] ac wa tle re = [ac, wa, tle, re]
calc (s:ss) ac wa tle re =
    case s of
        "AC" -> calc ss (ac+1) wa tle re
        "WA" -> calc ss ac (wa+1) tle re
        "TLE" -> calc ss ac wa (tle+1) re
        "RE" -> calc ss ac wa tle (re+1)

main = do
    n <- readLn
    ss <- replicateM n getLine
    let [ac, wa, tle, re] = calc ss 0 0 0 0
    putStrLn $ "AC x " ++ show ac
    putStrLn $ "WA x " ++ show wa
    putStrLn $ "TLE x " ++ show tle
    putStrLn $ "RE x " ++ show re