import Control.Monad
import Control.Applicative
import Data.List
solve :: [String] -> String
solve (n:ls) =
    let (l,r) = foldl' duel (0,0) $ map words ls in
    show l ++ " " ++ show r
    where
    duel :: (Int,Int) -> [String] -> (Int,Int)
    duel (pl,pr) [cl,cr]
        | cl < cr = (pl, pr+3)
        | cl > cr = (pl+3, pr)
        | otherwise = (pl+1, pr+1)

main =
    putStrLn =<< solve . lines <$> getContents 
