#include <bits/stdc++.h>
using namespace std;
long long n;
double f[100005], x, f1[1000005], f2[1000005], a[1000005];
signed main() {
  scanf("%d", &n);
  for (long long i = 1; i <= n; i++) scanf("%lf", &a[i]);
  for (long long i = 1; i <= n; i++) {
    f1[i] = a[i] * (f1[i - 1] + 1);
    f[i] = f[i - 1] + a[i] * (2 * f1[i - 1] + 1);
  }
  printf("%.13lf", f[n]);
  return 0;
}
