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