import Control.Monad
import Data.Array

getData = (\[a,b] -> ((read a) - 1,b)) . words <$> getLine :: IO (Int, String) 

penaltyPoint :: Array Int Int -> Array Int Int -> Int -> Int -> Int -> Int
penaltyPoint in1 in2 index n ans
 | index == n = ans
 | otherwise  = penaltyPoint in1 in2 (index + 1) n newAns
   where newAns = ans + ((in1 ! index) * (in2 ! index))

solve :: Int -> [(Int, String)] -> Array Int Int -> Array Int Int -> [Int]
solve n inData acList penaltyList
 | null inData     = [sum acList, penaltyPoint acList penaltyList 0 n 0] 
 | ansKind == "AC" = solve n (tail inData) newAcList penaltyList
 | (acList ! editElem) == 0 = solve n (tail inData) acList newPenaltyList
 | otherwise       = solve n (tail inData) acList penaltyList
   where editElem       = fst (head inData)
         ansKind        = snd (head inData)
         newAcList      = acList // [(editElem, 1)] -- replaceElem editElem 1 acList
         newPenaltyList = penaltyList // [(editElem, (penaltyList ! editElem) + 1)]-- 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 n inData (listArray (0,n) (repeat 0)) (listArray (0,n) (repeat 0))