import Control.Applicative
import Control.Monad

fight :: String -> (Int, Int) -> (Int, Int)
fight str (a, b) =
  let (t:h:_) = words str
  in
      if t < h
        then (a, b+3)
      else if t > h
        then (a+3, b)
      else
        (a+1, b+1)

solver :: [String] -> (Int, Int) -> String
solver [] (a, b) = show a ++ " " ++ show b
solver (x:xs) (a, b) = solver xs (fight x (a, b))

main :: IO()
main = do
  n <- (read :: String -> Int) <$> getLine
  cards <- replicateM n getLine
  putStrLn $ solver cards (0, 0)