#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  double ar[n], s = 0;
  for (int i = 0; i < n; i++) cin >> ar[i];
  int k = n - 1;
  while (k != 0) {
    s += (ar[k] + ar[k - 1]) / 2;
    k--;
  }
  cout << s << endl;
  return 0;
}
