#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int V[50] = {};
  for (int i = 0; i < N; i++) cin >> V[i];
  double c = 0.5;
  double ans = 0;
  for (int i = 0; i < N; i++) {
    ans += c * (double)V[i];
    if (i != N - 2) c *= 0.5;
  }
  cout.precision(15);
  cout << ans << endl;
}
