#include <bits/stdc++.h>
using namespace std;
bool cmpf(pair<long long, long long> left, pair<long long, long long> right) {
  return left.first < right.first;
}
int main() {
  long long n;
  cin >> n;
  vector<double> vec(n);
  for (long long i = 0; i < n; i++) cin >> vec[i];
  sort(vec.rbegin(), vec.rend());
  if (n % 2 == 0) {
    cout << (vec[0] + vec[1]) / 2;
  } else {
    cout << (((vec[0] + vec[1]) / 2 + vec[2]) / 2 >
                     (vec[0] + (vec[1] + vec[2]) / 2) / 2
                 ? ((vec[0] + vec[1]) / 2 + vec[2])
                 : (vec[0] + (vec[1] + vec[2]) / 2) / 2);
  }
}
