import Control.Applicative
import Control.Monad
import Data.Char
import Data.List

winScore :: [[String]] -> (Int,Int)
winScore [] = (0,0)
winScore (x:xs) = (tar + fst k ,han + snd k)
                  where (tar, han) = case (compare (x!!0) (x!!1)) of
                                       GT -> (3,0)
                                       EQ -> (1,1)
                                       LT -> (0,3)
                        k = winScore xs

main = do
    n <- readLn ::IO Int
    c <- replicateM n (words <$> getLine) :: IO [[String]]
    let (tar,han) = winScore c
    putStrLn $ show tar ++" "++ show han
    