#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, ma = 0, mb = 2222;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    ma = max(ma, x);
    mb = min(mb, x);
  }
  long long sum = ma + mb;
  sum /= 2;
  cout << sum << endl;
  return 0;
}
