import Control.Monad

main :: IO ()
main = do
  n <- readLn
  pts <- replicateM n $ do
    s <- getLine
    let [s1,s2] = words s
    return $ if s1 < s2 then (0,3) else if s1 > s2 then (3,0) else (1,1)
  let (p1,p2) = foldl (\(a,b) (c,d) -> (a+c,b+d)) (0,0) pts
  putStrLn $ show p1 ++ " " ++ show p2