{-# LANGUAGE FlexibleContexts, BangPatterns #-}

module Main where

import Data.Char
import Data.List
import Control.Monad
import Control.Monad.ST
import Data.Array.ST
import Data.Array.Unboxed
import Control.Applicative
import Text.Printf


readInt :: IO Int
readInt = read <$> (input `seq` input)
    where input = do
            !c <- getChar
            if isDigit c || c == '-'
                then (c :) <$> input
                else return []

prints :: Show a => [a] -> IO ()
prints as = putStrLn $ concat $ intersperse " " $ map show as

run [] = (0, 0)
run ([a,b]:tl) = let (s, t) = run tl
                     (sd, td) | a < b = (0, 3)
                              | a > b = (3, 0)
                              | otherwise = (1, 1)
                 in (s + sd, t + td)

main = do
    n <- readInt
    (s, t) <- run <$> replicateM n (words <$> getLine)
    putStrLn $ show s ++ " " ++ show t
