import Control.Monad
import Data.Array.Unboxed
import Data.Array.IO
import Data.IORef

main = do
    [n,m] <- map read . words <$> getLine :: IO [Int]
    ans <- newArray (1, n) (False, 0) :: IO (IOArray Int (Bool, Int))
    cs <- newIORef (0 :: Int)
    fs <- newIORef (0 :: Int)

    let
        solve :: IO () 
        solve =
            replicateM_ m $ do
                [p, s] <- words <$> getLine
                let pi = read p :: Int
                (a,f) <- readArray ans pi
                if (not a) && (s == "WA") 
                    then writeArray ans pi (False, f+1)
                else if (not a) && (s == "AC")
                    then writeArray ans pi (True, f)
                else return ()

        res :: IO ()
        res = 
            forM_ [1..n] $ \i -> do
                (a,f) <- readArray ans i
                when a $ do
                    modifyIORef cs (+1) 
                    modifyIORef fs (+f) 

    solve
    res
    readIORef cs >>= \c -> putStr $ show c
    putStr " "
    readIORef fs >>= \f -> putStrLn $ show f
