#include <bits/stdc++.h>
struct greaters {
  bool operator()(const long& a, const long& b) const { return a > b; }
};
using namespace std;
const int N = 200050;
const int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int tcase = 1, cas = 0;
  while (tcase--) {
    int n;
    cin >> n;
    vector<int> v;
    for (int i = 0; i < n; i++) {
      int a;
      cin >> a;
      v.push_back(a);
    }
    sort(v.begin(), v.end());
    cout << ((v[0] + v[1]) / 2.0 + v[n - 1]) / 2.0 << '\n';
  }
  return 0;
}
