#include<bits/stdc++.h>
#include<math.h>
using namespace std;

int main(){
  int N;
  cin >> N;
  int a[3*N];
  for (int i=0;i<3*N;i++) cin >> a[i];
  sort(a, a+3*N);

  int64_t sum = 0;
  for (int i=N;i<3*N;i+=2){
    sum += a[i];
  }

  cout << sum << endl;
}