#include <iostream>
#include <algorithm>
using namespace std;

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