import Control.Monad
main = do
  n <- readLn :: IO Int
  cards <- replicateM n $ (return . words) =<< getLine
  let (p1,p2) = foldl (\(x1,x2) (y1,y2) -> (x1+y1,x2+y2)) (0,0) $ map f1 cards
  putStrLn $ (show p1) ++ " " ++ (show p2)

f1 [c1,c2] | c1 > c2 = (3,0)
f1 [c1,c2] | c1 < c2 = (0,3)
f1 [c1,c2] | c1 == c2 = (1,1)
