module Main where

import Debug.Trace
import Control.Monad

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

import Data.Map (Map)
import qualified Data.Map as Map

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

-- | fuck!!!
-- The wrong answer only count when there exists an AC for that problem
checkSubmission :: (Set Int, Map Int Int, Int) -> (Int, Status) -> (Set Int, Map Int Int, Int)
checkSubmission (passed, wamap, wa) (id, status)
  | id `Set.member` passed = (passed, wamap, wa)
  | otherwise =
      -- traceShow (mconcat [show (id `Set.member` passed), " ", show id, " ", show wa, " ", show wamap, " ", show wa_count]) $
      case status of
        AC -> (id `Set.insert` passed, wamap, wa + wa_count)
        WA -> case wa_count of
                0 -> (passed, Map.insert id 1 wamap, wa)
                _ -> (passed, Map.adjust (+1) id wamap, wa)
  where
    wa_count = case Map.lookup id wamap of
                 Nothing -> 0
                 Just x -> x

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