output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      a_1 a_2 ... a_{3N}
attempt: # -*- coding: utf-8 -*-
  import sys
  import math
  import os
  import itertools
  import string
  import heapq
  import _collections
  from collections import Counter
  from collections import defaultdict
  from functools import lru_cache
  import bisect
  import re
  import queue
  
  
  class Scanner:
      @staticmethod
      def int():
          return int(sys.stdin.readline().rstrip())
  
      @staticmethod
      def string():
          return sys.stdin.readline().rstrip()
  
      @staticmethod
      def map_int():
          return [int(x) for x in Scanner.string().split()]
  
      @staticmethod
      def string_list(n):
          return [input() for i in range(n)]
  
      @staticmethod
      def int_list_list(n):
          return [Scanner.map_int() for i in range(n)]
  
      @staticmethod
      def int_cols_list(n):
          return [int(input()) for i in range(n)]
  
  
  class Math:
      @staticmethod
      def gcd(a, b):
          if b == 0:
              return a
          return Math.gcd(b, a % b)
  
      @staticmethod
      def lcm(a, b):
          return (a * b) // Math.gcd(a, b)
  
      @staticmethod
      def roundUp(a, b):
          return -(-a // b)
  
      @staticmethod
      def toUpperMultiple(a, x):
          return Math.roundUp(a, x) * x
  
      @staticmethod
      def toLowerMultiple(a, x):
          return (a // x) * x
  
      @staticmethod
      def nearPow2(n):
          if n <= 0:
              return 0
          if n & (n - 1) == 0:
              return n
          ret = 1
          while n > 0:
              ret <<= 1
              n >>= 1
          return ret
  
      @staticmethod
      def sign(n):
          if n == 0:
              return 0
          if n < 0:
              return -1
          return 1
  
      @staticmethod
      def isPrime(n):
          if n < 2:
              return False
          if n == 2:
              return True
          if n % 2 == 0:
              return False
          d = int(n**0.5) + 1
          for i in range(3, d + 1, 2):
              if n % i == 0:
                  return False
          return True
  
  
  class PriorityQueue:
      def __init__(self, l=[]):
          self.__q = l
          heapq.heapify(self.__q)
          return
  
      def push(self, n):
          heapq.heappush(self.__q, n)
          return
  
      def pop(self):
          return heapq.heappop(self.__q)
  
  
  MOD = int(1e09) + 7
  INF = int(1e15)
  
  
  def main():
      # sys.stdin = open("sample.txt")
      N = Scanner.int()
      A = Scanner.map_int()
      A.sort(reverse=True)
      print(sum(A[1 : N * 2 : 2]))
      return
  
  
  if __name__ == "__main__":
      main()
  
problem_description: Statement
  
  There are 3N participants in _AtCoder Group Contest_. The _strength_ of the
  i-th participant is represented by an integer a_i. They will form N teams,
  each consisting of three participants. No participant may belong to multiple
  teams.
  
  The strength of a team is defined as the second largest strength among its
  members. For example, a team of participants of strength 1, 5, 2 has a
  strength 2, and a team of three participants of strength 3, 2, 3 has a
  strength 3.
  
  Find the maximum possible sum of the strengths of N teams.
samples: [{"input": "2\n    5 2 8 5 1 5", "output": "10\n    \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n  * Team 1: consists of the first, fourth and fifth participants.\n  * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n    1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n    \n\nThe sum of the strengths can be quite large."}]