import Control.Monad
import Control.Applicative

computeScore x = foldr sumScore (0,0) x where
    sumScore [a,b] (c,d) = case (compare a b) of
        LT -> (c, d+3)
        EQ -> (c+1, d+1)
        GT -> (c+3, d)

myPrint (c,d) = putStrLn $ show c ++ " " ++ show d

main = do
    turns <- read <$> getLine
    cards <- replicateM turns $ words <$> getLine
    myPrint $ computeScore cards