#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
const double pi = acos(-1.0);
const int maxp = 1010, N = 1e5 + 10, MOD = 20000311;
double dp[N], a[N], p[N];
int n;
double solve(int n) {
  memset(dp, 0, sizeof(double) * (n + 1));
  memset(p, 0, sizeof(double) * (n + 1));
  for (int i = 1; i <= n; ++i) {
    scanf("%lf", &a[i]);
    p[i] = (p[i - 1] + 1) * a[i];
  }
  for (int i = 1; i <= n; i++) {
    dp[i] = dp[i - 1] * (1 - a[i]) + (dp[i - 1] - p[i - 1] * p[i - 1] +
                                      (p[i - 1] + 1) * (p[i - 1] + 1)) *
                                         a[i];
  }
  return dp[n];
}
int main() {
  int T, cases = 0;
  T = 1;
  while (T--) {
    scanf("%d", &n);
    printf("%.15f\n", solve(n));
  }
  return 0;
}
