{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE BinaryLiterals #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NumDecimals #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}

import Control.Applicative
import Control.Arrow
import Control.Monad
import Control.Monad.ST

import Data.Char
import Data.List
import Data.Maybe

import qualified Data.ByteString.Char8 as B

import Data.Array.ST.Safe
import Data.STRef

import Debug.Trace
import Text.Printf

readInt = readLn :: IO Int
readInteger = readLn :: IO Integer
readInts = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine
readIntegers = map ( fst . fromJust . B.readInteger ) . B.words <$> B.getLine

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

modifyArray a i f = writeArray a i =<< f <$> readArray a i

main = do
	[ n, m ] <- readInts
	[ ps, ss ] <- transpose . map words . ( ++ [ "1 WA" ] ) <$> replicateM m getLine
	uncurry ( printf "%d %d\n" ) $ solve n ( map ( pred . read ) ps ) ss

solve n ps ss = runST $ do
	let
		m = length ps
	acs <- newArray ( 0, n - 1 ) 0 :: ST s ( STUArray s Int Int )
	was <- newArray ( 0, n - 1 ) 0 :: ST s ( STUArray s Int Int )
	res_ac <- newSTRef 0
	res_wa <- newSTRef 0
	forM_ ( zip ps ss ) $ \( p, s ) -> do
		ac <- readArray acs p
		wa <- readArray was p
		if s == "AC" && ac == 0
			then do
				writeArray acs p 1
				modifySTRef res_ac succ
				modifySTRef res_wa ( + wa )
			else modifyArray was p succ
				-- s == "WA" && ac == 1 case will be discarded 
	res_ac' <- readSTRef res_ac
	res_wa' <- readSTRef res_wa
	return ( res_ac' :: Int, res_wa' )