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

int main(){
  long long n,a[500000],ans = 0;
  cin >> n;
  for(int i=0;i<3*n;i++){
    cin >> a[i];
  }
  sort(a,a + 3 * n,greater<int>());
  for(int i = 1;i < 2*n;i+=2){
    ans += a[i];
  }
  cout << ans << endl;
  return 0;
}