{-# LANGUAGE OverloadedStrings #-}
module Main where

import Data.List
import Data.Char (digitToInt)
import Control.Monad
import Debug.Trace
import qualified Data.ByteString.Char8 as BC
import Data.Maybe (fromJust, fromMaybe)
import qualified Data.Map.Strict as M
import qualified Data.Vector.Unboxed as V
import qualified Data.Set as S


readTuple2 :: IO (Int, Int)
readTuple2 = do
    [a, b] <- map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine
    return (a, b)

readTuple3 :: IO (Int, Int, Int)
readTuple3 = do
    [a, b, c] <- map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine
    return (a, b, c)

readInt :: IO Int
readInt = fst . fromJust . BC.readInt <$> BC.getLine

readInts :: IO [Int]
readInts = map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine

readIntBC :: IO (Int, BC.ByteString)
readIntBC = do
    [a, b] <- BC.words <$> BC.getLine
    return (fst . fromJust . BC.readInt $ a, b)

split :: (a -> Bool) -> [a] -> [[a]]
split f [] = []
split f as = let
    (fo, la) = span f as
    las = case la of
        [] -> []
        xs -> split f $ tail xs
    in
        case fo of
            [] -> las
            xs -> xs : las

fastPowerMod :: Int -> Int -> Int -> Int
fastPowerMod b 0 _ = 1
fastPowerMod b 1 modnum = b `mod` modnum
fastPowerMod b n modnum
            | even n = (fastPowerMod b (n `div` 2) modnum ^ 2) `mod` modnum
            | otherwise = (fastPowerMod b (n - 1) modnum * b) `mod` modnum


solve :: [(Int, BC.ByteString)] -> String
solve submits = let
    initial = (M.empty, S.empty, 0) -- wa count, ac, wa
    go (waMap, acSet, waCount) (qnum, "WA") = ((M.alter (\v -> Just $ (fromMaybe 0 v) + 1) qnum waMap), acSet, waCount)
    go (waMap, acSet, waCount) (qnum, "AC")
        | S.member qnum acSet = (waMap, acSet, waCount)
        | otherwise = (waMap, S.insert qnum acSet, waCount + M.findWithDefault 0 qnum waMap)
    (_, finalACSet, waCount) = foldl' go initial submits
    acCount = S.size finalACSet
    in
    show acCount ++ " " ++ show waCount
main = do
    (n,m ) <- readTuple2
    submits <- replicateM m readIntBC
    putStrLn $ solve submits

