#include <bits/stdc++.h>

#define fr first
#define sc second
#define mk make_pair
#define pb push_back
#define ll long long
#define ld long double
#define OK puts("OK");
#define sz(s) (int)s.size()
#define all(s) s.begin(), s.end()

using namespace std;

const int N = 1e5 + 10;
const ll inf = 1e15 + 7;

int n;
int a[3*N];
ll ans;

main()
{
    scanf("%d", &n);
    n *= 3;
    for(int i = 1 ; i <= n ; i ++)
        scanf("%d", &a[i]);
    sort(a + 1, a + n + 1);
    for(int i = n - 1 ; i > n / 3 ; i -= 2)
        ans += a[i];
    printf("%lld\n", ans);

}
