#include <bits/stdc++.h>
using namespace std;
double f[2], len[2], x;
int main() {
  int n, now = 0;
  scanf("%d", &n);
  for (register int i = 1; i <= n; ++i) {
    scanf("%lf", &x);
    f[now ^ 1] = f[now] + 2 * x * len[now] + x;
    len[now ^ 1] = (len[now] + 1) * x;
    now ^= 1;
  }
  printf("%.7lf", f[now]);
  return 0;
}
