#include <bits/stdc++.h>
int num() {
  char s[11];
  int i, n;
  for (i = 0; i < sizeof(s); i++) {
    s[i] = getchar();
    if (s[i] == ' ' || s[i] == '\n') {
      s[i] = '\0';
      break;
    }
  }
  sscanf(s, "%d", &n);
  return n;
}
int asc(const void *a, const void *b) { return *(int *)a - *(int *)b; }
int main(void) {
  int n, i;
  int a[300001];
  long ans = 0;
  n = num();
  for (i = 0; i <= n * 3; i++) {
    a[i] = num();
  }
  qsort(a, sizeof(a) / sizeof(int), sizeof(int), asc);
  for (i = n; i < n + n; i++) {
    ans += a[i];
  }
  printf("%ld\n", ans);
  return 0;
}
