import Control.Monad
import Data.List
import Data.Maybe
import qualified Data.Map.Strict as M

solve :: M.Map Int (Int,Int) -> (Int, String) -> M.Map Int (Int,Int)
solve m (i, "AC")
    | m' == Nothing = M.insert i (1,0) m
    | fst (fromJust m') > 0 = m
    | otherwise = M.insert i (fst (fromJust m') + 1,snd (fromJust m')) m
        where
            m' = M.lookup i m
solve m (i, "WA")
    | m' == Nothing = M.insert i (0,1) m
    | fst (fromJust m') > 0 = m
    | otherwise = M.insert i (fst (fromJust m'),snd (fromJust m') + 1) m
        where
            m' = M.lookup i m

main = do
    [n,m] <- map read . words <$> getLine :: IO [Int]
    psm <- map (\xs -> (read (xs!!0)::Int,xs!!1)) <$> map words <$> replicateM m getLine
    putStrLn $ unwords $ map show $ foldl (\[x,y] (z,w) -> [x+z,y+w] ) [0,0] $ M.elems $ foldl solve M.empty psm
    
