import Data.List (sortBy)
import Data.Array

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

solve :: Int -> [Int] -> Int
solve n as = sum [arr ! (2*i) | i <- [1 .. n]]
    where
        arr = array (1, 2*n) $ zip [1 .. 2*n] as'
        as' = take (2*n) $ sortBy (flip compare) as
