#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
long long a[N];
long long sum[N];
int main() {
  int n;
  cin >> n;
  long long tot = 0;
  for (int i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
    ;
    tot += a[i];
  }
  sort(a, a + n);
  long long res = 100000000000000000LL;
  long long ans = 100000000000000000LL;
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    long long temp = (1LL * i * a[i] - sum);
    long long temp2 = (tot - a[i] - sum) - 1LL * (n - (i + 1)) * a[i];
    if (abs(temp + temp2) < res) {
      ans = a[i];
      res = abs(temp + temp2);
    }
    sum += a[i];
  }
  cout << ans << endl;
}
