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

main :: IO ()
main = do
  num <- getLine
  cards <- replicateM (read num) (words <$> getLine)
  putStrLn $ unwords $ map show $ foldl check [0, 0] cards
    where
      check [taro, hanako] [card1, card2]
        | card1 > card2 = [taro+3, hanako]
        | card1 < card2 = [taro, hanako+3]
        | otherwise = [taro+1, hanako+1]
