import Control.Applicative
import Data.List

main = do
  n <- readLn :: IO Int
  as <- reverse . sort . map read . words <$> getLine :: IO [Integer]

  print $ sum $ solve $ take (2*n) as
  where
    solve [] = []
    solve (x:y:xs) = y : solve xs
