#include <bits/stdc++.h>
double A[200000], B[200000], C[200000];
int i, j, n, m;
double p;
int main() {
  scanf("%d", &n);
  C[0] = 1;
  for (i = 1; i <= n; i++) {
    scanf("%lf", &p);
    C[i] = p * (C[i - 1]) + 1 - p;
    B[i] = p * (B[i - 1] + C[i - 1]);
    A[i] = (A[i - 1] + 2 * B[i - 1] + C[i - 1]) * p + (1 - p) * A[i - 1];
  }
  printf("%.9lf\n", A[n]);
}
