#include <bits/stdc++.h>
using namespace std;
int n;
double a, f1, f2;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%lf", &a);
    f2 = f2 + (f1 * 2 + 1) * a;
    f1 = (f1 + 1) * a;
  }
  printf("%.15lf", f2);
  return 0;
}
