import qualified Data.Set as Set
import qualified Data.Map.Strict as Map

main = do
  n:m:_ <- map read . words <$> getLine :: IO [Int]
  pss <- map ((\(p:s:_) -> (read p, s)) . words) <$> lines <$> getContents :: IO [(Int, String)]
  putStrLn $ unwords . map show $ count n pss

count n pss = [Set.size ac, Map.foldr' (+) 0 $ Map.filter (flip Set.member ac) wa]
    where (ac,wa) = foldl step (Set.empty, Map.fromList [ (i, 0) | i <- [1..n] ]) pss
          step (ac,wa) (p,s)
            | Set.member p ac = (ac, wa)
            | s == "WA" = (ac, Map.insert p ((wa Map.! p) + 1) wa)
            | s == "AC" = (Set.insert p ac, wa)
