#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  double p[n + 2];
  p[0] = 0.0;
  p[n + 1] = 0.0;
  for (int i = 1; i <= n; i++) cin >> p[i];
  double p0 = 0.0, p1 = 0.0, p2 = 0.0;
  double ans = 0.0;
  for (int i = 1; i <= n; i++) {
    double P0 = p0 * p[i] + (1.0 - p[i - 1]) * p[i];
    double P1 = (p1 + p0) * p[i] + (1.0 - p[i - 1]) * p[i];
    double P2 = (p2 + 2 * p1 + p0) * p[i] + (1.0 - p[i - 1]) * p[i];
    ans += P2 * (1 - p[i + 1]);
    p0 = P0, p1 = P1, p2 = P2;
  }
  printf("%.9f\n", ans);
  return 0;
}
