#include <bits/stdc++.h>
using namespace std;
struct shi {
  int x = 0;
  int T;
} ma[1000000];
int cmd(shi a, shi b) { return a.x < b.x; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int N;
  cin >> N;
  int hh[100000];
  for (int i = 0; i < N; i++) {
    cin >> hh[i];
  }
  sort(hh, hh + N);
  int aa[100000] = {0};
  int pp = 0, mm = 0;
  for (int i = 0; i < N; i++) {
    ma[i].T = hh[i];
    for (int j = 0; j < N; j++) {
      ma[i].x = max(abs(hh[i] - hh[j]), ma[i].x);
    }
  }
  sort(ma, ma + N, cmd);
  cout << ma[0].T << endl;
  return 0;
}
