#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
void solve(istream& cin, ostream& cout) {
  int n;
  cin >> n;
  vector<long double> v(n);
  for (int i = (0); i <= (n - 1); i++) cin >> v[i];
  sort(v.begin(), v.end());
  long double ans;
  if (n == 2)
    ans = (v[0] + v[1]) / 2;
  else
    ans = ((v[n - 3] + v[n - 2]) / 2 + v[n - 1]) / 2;
  cout << ans << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cout << fixed;
  solve(cin, cout);
  return 0;
}
