import qualified Data.ByteString.Char8 as B
import qualified Data.Array.IArray as A
import Control.Arrow
import Data.List

main = do
  n <- readLn
  as <- map (maybe undefined fst . B.readInteger) . B.words <$> B.getLine
  print (agc n as)

agc n =  sum . take n . unfoldr (return . (head &&& drop 2)) . drop n . sort