#include <bits/stdc++.h>
using namespace std;
int N;
vector<double> v;
int main() {
  cin >> N;
  double num;
  for (int i = 1; i <= N; i++) {
    cin >> num;
    v.push_back(num);
  }
  sort(v.begin(), v.end());
  double max = v[v.size() - 1];
  if (N > 2) {
    double jamu = ((v[v.size() - 2] + v[v.size() - 3]) / 2);
    double ans = (max + jamu) / 2;
    cout << ans << '\n';
  } else {
    if (N == 2) {
      cout << ((v[0] + v[1]) / 2) << '\n';
    }
  }
  return 0;
}
