#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[10000], i, k, l;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  k = a[0];
  for (i = 1; i < n; i++) {
    k = (k + a[i]) / 2;
  }
  l = a[n - 1];
  for (i = n; i > 1; i--) {
    l = (l + a[i]) / 2;
  }
  cout << max(l, k) << endl;
  return 0;
}
