import Control.Monad

getData = (\[a,b] -> ((read a) - 1,b)) . words <$> getLine :: IO (Int, String) 
replaceElem n newElement xs = take n xs ++ [newElement] ++ drop (n + 1) xs

solve :: [(Int, String)] -> [Int] -> [Int] -> [Int]
solve inData acList penaltyList
 | null inData     = [sum acList, sum (zipWith (*) acList penaltyList)] 
 | ansKind == "AC" = solve (tail inData) newAcList penaltyList
 | (acList !! editElem) == 0 = solve (tail inData) acList newPenaltyList
 | otherwise       = solve (tail inData) acList penaltyList
   where editElem       = fst (head inData)
         ansKind        = snd (head inData)
         newAcList      = replaceElem editElem 1 acList
         newPenaltyList = replaceElem editElem ((penaltyList !! editElem) + 1) penaltyList

main = do
 [n,m] <- map read . words <$> getLine :: IO [Int]
 inData <- replicateM m getData
 putStr $ unwords $ map show $ solve inData (replicate n 0) (replicate n 0)