#include <bits/stdc++.h>
using namespace std;
double p[1000010];
double solve(int n) {
  double ans = 0;
  double tmp = 0;
  double sum = 0;
  for (int i = 1; i <= n; i++) {
    tmp = (tmp + sum * 2 + 1 - p[i - 1]) * p[i];
    sum = (sum + 1 - p[i - 1]) * p[i];
    ans += tmp;
  }
  return ans;
}
int main() {
  int i, j;
  int m, n, t;
  while (scanf("%d", &n) != EOF) {
    for (i = 1; i <= n; i++) {
      scanf("%lf", &p[i]);
    }
    p[0] = 0;
    printf("%.10lf\n", solve(n));
  }
  return 0;
}
