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

typedef long long ll;

int main()
{
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
    int n;
    cin >> n;

    int a[n*3];
    for(int i = 0;i < n*3;i ++)
         scanf("%d",&a[i]);

    ll s = 0;
    sort(a, a + 3*n);
    for(int i = 3*n - n - 1;i >= 3*n - 2*n;i --){
          s += a[i];
    }
    cout << s;
	return 0;
}
