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

main :: IO ()
main = do
  n <- readLn
  ls <- reverse . sort . map read . words <$> getLine
  print $ sum . map snd . take n . filter (even . fst) . zip [1..3*n] $ ls