#include <bits/stdc++.h>
using namespace std;
double p[100000];
int main() {
  int i, j, k, n;
  scanf("%d", &n);
  double now, an = 0;
  for (i = 0; i < n; i++) {
    scanf("%lf", &p[i]);
    an += p[i];
  }
  now = 0;
  for (i = 0; i < n; i++) {
    an += now * p[i];
    now = (now + 1) * p[i];
  }
  now = 0;
  for (i = n - 1; i >= 0; i--) {
    an += now * p[i];
    now = (now + 1) * p[i];
  }
  printf("%.15lf\n", an);
  return 0;
}
