#include <bits/stdc++.h>
using namespace std;
double f[100003], g[100003];
int n;
int main() {
  scanf("%d", &n);
  f[0] = 0;
  g[0] = 0;
  for (int i = 1; i <= n; i++) {
    double p;
    scanf("%lf", &p);
    g[i] = (g[i - 1] + 1) * p;
    f[i] = f[i - 1] - (g[i - 1] * g[i - 1]);
    f[i] += (g[i - 1] + 1) * (g[i - 1] + 1);
    f[i] *= p;
    f[i] += f[i - 1] * (1.0 - p);
  }
  printf("%.12lf\n", f[n]);
}
