#include "bits/stdc++.h"
#define double long double
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int a[334334];int n,ans=0;
signed main() {
	cin>>n;
	rep(i,3*n)cin>>a[i];
	sort(a,a+3*n);
	for(int i=1;i<=n;i++)ans+=a[3*n-2*i];
	cout<<ans<<endl;
}