import qualified Data.ByteString.Char8 as BS
import Data.Maybe
import qualified Data.Map as Map
import Data.List

import Control.Monad
import Control.Monad.State

import Data.Char
import Data.Ord

import Text.Printf

getInts :: IO [Int]
getInts = map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine

main :: IO ()
main = do
  [n, m] <- getInts
  ps <- replicateM m $ do
    (\[p, s] -> (fst . fromJust . BS.readInt $ p, BS.unpack s)) . BS.words  <$> BS.getLine

  let temp = filter (elem "AC") . map (map snd) . groupBy (\(x,_) (y,_) -> x == y) . sortBy (\(x,_) (y,_) -> compare x y) $ ps

  let ac = length temp

  let penalty = sum $ map (length . takeWhile (== "WA")) temp

  printf "%d %d\n" ac penalty
