#include <bits/stdc++.h>
double p[100001];
int main() {
  int n, i;
  double ans, tmp, all, s, b, var;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%lf", &p[i]);
    p[i] = 1 - p[i];
  }
  ans = (1 - p[1]);
  all = (1 - p[1]);
  s = 0;
  b = 0;
  for (i = 2; i <= n; i++) {
    var = (double)((i - 1) * 1.0);
    var = var * var;
    var = var * all;
    all = all * (1 - p[i]);
    tmp = (double)(i * 1.0);
    tmp = tmp * tmp;
    tmp = all * tmp;
    ans += tmp;
    b = (b + 2 * s) * (1 - p[i - 1]) + p[i - 1];
    tmp = (1 - p[i]) * (b);
    ans += tmp;
    ans -= var * (1 - p[i]);
    s = s * (1 - p[i - 1]) + p[i - 1];
  }
  printf("%lf\n", ans);
  return 0;
}
