#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long inf = LLONG_MAX;
const long long N = 1e5 + 10;
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int a;
  cin >> a;
  double s[a], f, g, h;
  for (int i = 0; i < a; ++i) {
    cin >> s[i];
  }
  sort(s, s + a);
  if (a > 2) {
    f = (s[a - 3] + s[a - 2]) / 2;
    g = (f + s[a - 1]) / 2;
    cout << g << "\n";
  } else {
    h = (s[a - 2] + s[a - 1]) / 2;
    cout << h << "\n";
  }
  return 0;
}
