#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n;
double p[maxn], dp[maxn], x[maxn];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> p[i];
  dp[0] = 0, x[0] = 0;
  for (int i = 1; i <= n; i++) {
    x[i] = p[i] * (1 + x[i - 1]);
    dp[i] = p[i] * (dp[i - 1] - x[i - 1] * x[i - 1] +
                    (x[i - 1] + 1) * (1 + x[i - 1])) +
            (1 - p[i]) * dp[i - 1];
  }
  printf("%.8lf", dp[n]);
}
