import Control.Monad
import Data.List

main = do
  li <- getLine
  let [n,m] = map read $ words li
  pss <- forM [1..m] (\_ -> do
    li <- getLine
    let [pi,si] = words li
    return (read pi, si == "AC")
    )
  let (s,p) = compute n m pss
  putStrLn $ unwords [show s, show p]

compute :: Int -> Int -> [(Int,Bool)] -> (Int,Int)
compute n m pss = (score, sum $ map penal xs)
  where
    psl (pi,si) = [ if pi == i then Just si else Nothing | i <- [1..n] ]
    m2s xs = [ b | Just b <- xs ]
    xs = map m2s $ transpose $ map psl pss
    score = length $ filter (elem True) xs
    penal xs
      | notElem True xs = 0
      | otherwise = length $ takeWhile not xs
