#include <bits/stdc++.h>
using namespace std;
void bad(string mes = "impossible") {
  cout << mes;
  exit(0);
}
template <typename T>
string bin(T x, int st = 2) {
  string ans = "";
  while (x > 0) {
    ans += char('0' + x % st);
    x /= st;
  }
  reverse(ans.begin(), ans.end());
  return ans.empty() ? "0" : ans;
}
template <typename T>
T dcm(string& second) {
  T x = 0;
  for (int i = 0; i < second.size(); i++) {
    x = (x * 2) + (second[i] == '1');
  }
  return x;
}
template <typename T>
T input() {
  T ans = 0, m = 1;
  char c = ' ';
  while (c == ' ' || c == '\n') c = getchar();
  if (c == '-') m = -1, c = getchar();
  while (c >= '0' && c <= '9') {
    ans = ans * 10 + int(c - '0'), c = getchar();
  }
  return ans * m;
}
template <typename T>
T binpow(T n, T second) {
  if (second <= 0) return 1LL;
  if (second % 2 == 0) {
    T b = binpow(n, second / 2);
    return (1LL * b * b);
  } else {
    return (1LL * binpow(n, second - 1) * n);
  }
}
string is() {
  string str;
  cin >> str;
  return str;
}
const int inf = 2e9;
const double eps = 1e-9;
const int maxn = 2e6 + 10, base = 1e9 + 7;
const long long llinf = 1e18;
int main() {
  int n = input<int>();
  int mi = inf, ma = 0;
  for (int i = 0; i < n; i++) {
    int g = input<int>();
    mi = min(mi, g);
    ma = max(ma, g);
  }
  cout << ((mi + ma) >> 1);
  return 0;
}
