-- String - Card Game

import Control.Applicative

main :: IO ()
main = do
  n  <- readLn
  xs <- map words . take n . lines <$> getContents
  putStrLn $ unwords $ map show $ foldr count [0, 0] xs

count :: [String] -> [Int] -> [Int]
count [a, b] [x, y]
  | a > b     = [x + 3, y]
  | a == b    = [x + 1, y + 1]
  | otherwise = [x, y + 3]

