#include <bits/stdc++.h>
using namespace std;
int main() {
  double sommezarbi = 1, somme = 1;
  int n, i;
  double p;
  double score = 0;
  scanf("%d\n", &n);
  for (i = 0; i < n; i++) {
    scanf("%lf", &p);
    score += p * sommezarbi;
    sommezarbi = (1 - p) + p * (sommezarbi + 2 * somme);
    somme = (1 - p) + p * somme;
  }
  printf("%.12lf\n", score);
  return 0;
}
