#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  double s = 0.0, res = 0.0;
  while (n--) {
    double p;
    scanf("%lf", &p);
    s = s * p + p;
    res += 2 * s - p;
  }
  printf("%lf\n", res);
  return 0;
}
