#include <bits/stdc++.h>
using namespace std;
int const M = 1e5 + 5;
int md = 1e9 + 7;
int i, j, n, m, N, t, k, x, y;
int a[M];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  cout << (a[n - 1] + a[0]) / 2;
}
