import qualified Data.ByteString.Char8 as C
import           Data.Maybe ( fromJust )
import           Data.List ( sortBy )
import qualified Data.Vector.Unboxed as U

getParm :: IO [Int]
getParm = map (fst . fromJust . C.readInt) . C.words <$> C.getLine

main :: IO ()
main = do
  n <- readLn :: IO Int
  ass <- getParm
  print $ f' n ass

sort' :: [Int] -> [Int]
sort' = sortBy (flip compare)

f' n ass = sum [vs U.! i | i<- [1,3 .. 2*n-1]
                         , let vs = U.fromList (sort' ass)]