import Data.List ( sortBy )

main :: IO ()
main = do
  n <- readLn :: IO Int
  ass <- map read . words <$> getLine :: IO [Int]
  print $ g n ass

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

f :: Int -> [Int] -> [Int]
f n ass = take n $ h ass'
  where
    h :: [Int] -> [Int]
    h (a:b:bs) = b: h bs

    ass' = sort' ass

g n = sum . f n