import Control.Applicative
import Control.Monad
import Data.List

solve :: Int -> [Int] -> Int
solve n as = sum cs
  where
    bs = take (2 * n) (sortBy (flip compare) as)
    f [] = []
    f (x:y:ys) = y : f ys
    cs = f bs

main :: IO ()
main = do
    n <- readLn :: IO Int
    as <- fmap read . words <$> getLine :: IO [Int]
    print $ solve n as