import qualified Text.Printf as Text

newtype Count = Count { getCount :: (Int, Int, Int, Int) }

instance Show Count where
  show c = Text.printf "AC x %d\nWA x %d\nTLE x %d\nRE x %d" ac wa tle re
    where
      (ac, wa, tle, re) = getCount c

count :: [String] -> Count
count xs = Count $ classify xs (0, 0, 0, 0)
  where
    classify (x:xs) (ac, wa, tle, re)
      | x == "AC" = classify xs (ac + 1, wa, tle, re)
      | x == "WA" = classify xs (ac, wa + 1, tle, re)
      | x == "TLE" = classify xs (ac, wa, tle + 1, re)
      | x == "RE" = classify xs (ac, wa, tle, re + 1)
      | otherwise = error $ "Invalid input. " ++ x
    classify [] result = result

main :: IO ()
main = readLn >>= getInput >>= print . count
  where
    getInput n = sequence $ replicate n getLine