{-# LANGUAGE OverloadedStrings #-}
import qualified Data.ByteString.Char8 as B
import qualified Data.IntMap.Strict    as M
import           Data.List             (elemIndex, foldr)
import           Data.Maybe            (catMaybes, fromJust)


data Result = AC | WA
  deriving (Eq, Show)

parseLine :: B.ByteString -> (Int, Result)
parseLine s = (fst . fromJust $ B.readInt x1, readResult x2)
  where [x1, x2] = B.words s

readResult :: B.ByteString -> Result
readResult "AC" = AC
readResult "WA" = WA

main :: IO ()
main = do
  [n, m] <- map read . words <$> getLine
  pss <- map parseLine . B.lines <$> B.getContents
  let (a, b) = solve n m pss
  putStrLn . unwords $ map show [a, b]

solve :: Int -> Int -> [(Int, Result)] -> (Int, Int)
solve _ _ pss = (a, b) where
  xs = M.elems $ foldr f M.empty pss :: [[Result]]
  ys = catMaybes $ map (elemIndex AC) xs :: [Int]
  a = length ys
  b = sum ys

f :: (Int, Result) -> M.IntMap [Result] -> M.IntMap [Result]
f (p, s) xs = M.alter g p xs where
  g Nothing   = Just [s]
  g (Just ss) = Just (s:ss)
