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