#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100005;
int n;
double p[MAX_N];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> p[i];
  double res = 0.0;
  double tmp = 0.0;
  for (int i = 0; i < n; ++i) {
    res += (2.0 * tmp + 1.0) * p[i];
    tmp = (tmp + 1.0) * p[i];
  }
  printf("%.10lf\n", res);
  return 0;
}
