#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 300005;
int a[MAX_N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  long long sum = 0;
  for (int i = 1; i < n; i++) sum += (long long)a[i] - (long long)a[0];
  long long ans = sum;
  int p = a[0];
  long long cnt_left = 0;
  long long cnt_right = n;
  for (int i = 1; i < n; i++) {
    cnt_left++;
    cnt_right--;
    long long x = (long long)a[i] - (long long)a[i - 1];
    sum += cnt_left * x - cnt_right * x;
    if (sum < ans) {
      ans = sum;
      p = a[i];
    }
  }
  cout << p;
  return 0;
}
