#include <bits/stdc++.h>
using namespace std;
double f[300005], g[300005];
char get() {
  char c = getchar();
  while (c != 'o' && c != 'x' && c != '?') c = getchar();
  return c;
}
int main() {
  int n;
  scanf("%d", &n);
  f[0] = g[0] = 0;
  for (int i = 1; i <= n; i++) {
    double p;
    scanf("%lf", &p);
    f[i] = f[i - 1] + (2 * g[i - 1] + 1) * p;
    g[i] = (g[i - 1] + 1) * p;
  }
  printf("%.15f\n", f[n]);
  return 0;
}
