import Data.Functor( (<$>))
import Control.Monad( replicateM)

main = do
    n <- read <$> getLine
    vss <- replicateM n getLine
    let
	battle vs = let
			[tar,han] = words vs
		    in
			case tar `compare` han of
			    LT	-> (0,3)
			    EQ	-> (1,1)
			    GT	-> (3,0)

	(tScore, hScore) = unzip $ battle <$> vss

    putStrLn $ (show $ sum tScore)++" "++(show $ sum hScore)

