#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  priority_queue<float, vector<float>, greater<float> > pq;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    pq.push(a[i]);
  }
  double x, y, ans = 0;
  while (pq.empty() == false) {
    if (pq.empty() == true) {
      break;
    }
    x = pq.top();
    pq.pop();
    if (pq.empty() == true) {
      break;
    }
    y = pq.top();
    pq.pop();
    ans += (x + y) / 2;
    pq.push((x + y) / 2);
  }
  cout << ans;
}
