#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  double sm = 0.0;
  double a = 0.0;
  double prob;
  for (int i = 1; i <= n; i++) {
    cin >> prob;
    sm += ((2.0 * a) + 1.0) * prob;
    a = (a + 1.0) * prob;
  }
  printf("%.6lf", sm);
  return 0;
}
