#include <bits/stdc++.h>
using namespace std;
const int64_t INF = 1000LL * 1000LL * 1000LL * 1000LL * 1000LL * 1000LL;
struct init {
  init() {
    srand(time(NULL));
    cin.tie(NULL);
    cout.tie(NULL);
    ios_base::sync_with_stdio(false);
  }
} init;
int64_t n;
vector<int64_t> v;
void input() {
  cin >> n;
  v.resize(n);
  for (int64_t i = 0; i < v.size(); ++i) {
    cin >> v[i];
  }
}
int64_t f(int64_t i) {
  int64_t ret = 0;
  for (int64_t j = 0; j < v.size(); ++j) {
    ret += abs(v[i] - v[j]);
  }
  return ret;
}
void solve() {
  sort(v.begin(), v.end());
  int64_t ansV = f(0);
  int64_t ans = v[0];
  if (v.size() < 20) {
    for (int64_t i = 0; i < v.size(); ++i) {
      if (f(i) < ansV) {
        ansV = f(i);
        ans = v[i];
      }
    }
  } else {
    for (int64_t i = v.size() / 2 - 2; i <= v.size() / 2 + 2; ++i) {
      if (f(i) < ansV) {
        ansV = f(i);
        ans = v[i];
      }
    }
  }
  cout << ans;
}
int32_t main() {
  input();
  solve();
  return 0;
}
