#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int *arr = new int[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  int min = (arr[n - 1] + arr[0]) / 2;
  int m = 2100;
  for (int i = 0; i < n; i++) {
    if (abs(min - arr[i]) < m) m = abs(arr[i] - min);
  }
  for (int i = 0; i < n; i++)
    if (abs(min - arr[i]) == m) {
      min = arr[i];
      break;
    }
  cout << min;
  delete arr;
  return 0;
}
