import Control.Monad
solv :: (Int, Int) -> [String] -> (Int, Int)
solv res [] = res
solv (t, s) (x:xs) = case tw `compare` sw of
                        LT -> solv (t, (s+3)) xs
                        EQ -> solv ((t+1), (s+1)) xs
                        GT -> solv ((t+3), s) xs

  where
    (tw:sw:_) = words x
main = do
  n <- getLine
  l <- replicateM (read n) getLine
  putStrLn . (\(t, s) -> show t ++ " " ++ show s) $ solv (0, 0) l