import Control.Applicative
import Data.List
import Data.Maybe
import qualified Data.ByteString.Char8 as BS

readIntBS = fst . fromJust . BS.readInt

main = do
  n <- readLn :: IO Int
  as <- reverse . sort . map (fromIntegral . readIntBS) . BS.words <$> BS.getLine :: IO [Integer]

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