import Control.Monad

solve :: [String] -> (Int, Int)
solve xs = foldl (\a ws -> f ws a) (0, 0) $ map words xs
    where
        f [s, t] (x, y)
            | s < t     = (x,     y + 3)
            | t < s     = (x + 3, y    )
            | otherwise = (x + 1, y + 1)

main :: IO ()
main = do
    n  <- readLn
    ss <- replicateM n getLine
    let (x, y) = solve ss
    putStrLn (show x ++ " " ++ show y)