import Control.Monad

addPoints :: [String] -> [Int] -> [Int]
addPoints [sa, sb] [a, b] | sa > sb = [a + 3, b]
                          | sa < sb = [a, b + 3]
                          | otherwise = [a + 1, b + 1]

main :: IO ()
main = do
  n <- readLn
  inputs <- fmap (map words) $ replicateM n getLine
  putStrLn $ unwords $ map show $ foldr addPoints [0, 0] inputs