#include <bits/stdc++.h>
using namespace std;
double v[1000002];
int main(void) {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> v[i];
  double answ = v[0];
  double acc = v[0];
  for (int i = 1; i < n; i++) {
    answ += 2 * v[i] * acc + v[i];
    acc = acc * v[i] + v[i];
  }
  printf("%.10lf\n", answ);
  return 0;
}
