#include <bits/stdc++.h>
const int MAXN = 100000;
using namespace std;
inline int read() {
  int x = 0, w = 1;
  char c = ' ';
  while (!isdigit(c)) {
    c = getchar();
    if (c == '-') w = -1;
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  return x * w;
}
int n;
double p[MAXN + 5], x[MAXN + 5], y[MAXN + 5];
void init() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%lf", &p[i]);
}
int main() {
  init();
  for (int i = 1; i <= n; ++i) {
    y[i] = p[i] * (y[i - 1] + 1);
    x[i] = p[i] * (x[i - 1] + 2 * y[i - 1] + 1) + (1 - p[i]) * x[i - 1];
  }
  printf("%.10f\n", x[n]);
  return 0;
}
