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