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