#include <bits/stdc++.h>
int n;
int main() {
  scanf("%d", &n);
  double sum = 0, add = 0;
  for (int i = 1; i <= n; ++i) {
    double x;
    scanf("%lf", &x);
    sum += (2 * add + 1) * x;
    add = (add + 1) * x;
  }
  printf("%.15lf\n", sum);
  return 0;
}
