#include <bits/stdc++.h>
using namespace std;
int n;
double ans;
priority_queue<double> q;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (register int i = 1; i <= n; ++i) {
    double t;
    cin >> t;
    q.push(-t);
  }
  while (q.size() > 1) {
    double a = q.top();
    q.pop();
    double b = q.top();
    q.pop();
    ans += ((a + b) / 2.0);
    q.push((a + b) / 2.0);
  }
  cout << -ans << endl;
  return 0;
}
