#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int a[N];
  int b, tmp = 100;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    b += a[i];
  }
  b--;
  for (int i = 0; i < N; i++) {
    if (tmp >= std::abs(b / N - a[i])) {
      tmp = a[i];
    }
  }
  cout << tmp << endl;
  return 0;
}
