module Main where

import Debug.Trace
import Control.Monad

import Data.Set (Set)
import qualified Data.Set as Set

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, wa) (id, status)
  | id `Set.member` passed = (passed, wa)
  | status == WA = (passed, wa + 1)
  | status == AC = (id `Set.insert` passed, wa)

main =
  (map (read :: String -> Int) . words) <$> getLine >>= \[n, m]->
  replicateM m ((readSubmission . words) <$> getLine) >>= \submissions ->
  let
    (passed, wa) = foldl checkSubmission (Set.empty :: Set Int, 0) submissions
  in
    if m == 0
       then putStrLn "0 0"
       else putStrLn $ mconcat [show (Set.size passed), " ", show wa]
