#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  float a[100000];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  float ans = 0;
  if (n == 2) {
    cout << (a[0] + a[1]) / 2;
    return 0;
  } else {
    sort(a, a + n);
    ans = ((a[n - 2] + a[n - 3]) / 2 + (a[n - 1])) / 2;
    cout << ans;
    return 0;
  }
}
