module Main where

import Control.Monad

data Status = AC
            | WA
            deriving (Show, Eq)

readSubmission :: [String] -> (Int, Status)
readSubmission s = (read (head s), status)
  where
    status =
      case last s of
        "AC" -> AC
        "WA" -> WA

checkSubmission :: ([Int], (Int, Int)) -> (Int, Status) -> ([Int], (Int, Int))
checkSubmission (passed, (ac, wa)) (id, status)
  | elem id passed = (passed, (ac, wa))
  | status == WA = (passed, (ac, wa + 1))
  | status == AC = (passed ++ [id], (ac + 1, wa))

main =
  (map (read :: String -> Int) . words) <$> getLine >>= \[n, m]->
  replicateM m ((readSubmission . words) <$> getLine) >>= \submissions ->
  let
    (_, (a, b)) = foldl checkSubmission ([], (0, 0)) submissions
  in putStrLn $ mconcat [show a, " ", show b]
