import Control.Applicative
import Control.Monad
import Data.Array
import Data.Array.ST
import Data.Char
import Data.List
import qualified Data.Map as M
import qualified Data.Set as S
import Text.Printf

readInts :: IO [Int]
readInts = map read . words <$> getLine

main :: IO ()
main = do
  n <- readLn
  wss <- replicateM n (words <$> getLine)
  let (p1,p2) = solve wss
  printf "%d %d\n" p1 p2

solve :: [[String]] -> (Int, Int)
solve = foldl f (0, 0)
 where
  f (p1,p2) [w1,w2] = case (compare w1 w2) of
    LT -> (p1, p2 + 3)
    EQ -> (p1 + 1, p2 + 1)
    GT -> (p1 + 3, p2)

