#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, num;
  priority_queue<int> q;
  while (!q.empty()) {
    q.pop();
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> num;
    q.push(-num);
  }
  float sum = 0.0, a, b;
  while (q.size() > 1) {
    a = q.top();
    q.pop();
    b = q.top();
    q.pop();
    sum += a + b;
    q.push(a + b);
  }
  if (n <= 2) cout << -sum / 2 << endl;
  if (n > 2) cout << -sum / (4 * (n - 2)) << endl;
  return 0;
}
