#include <bits/stdc++.h>
using namespace std;
double p[100010];
int main(void) {
  int N, i;
  scanf("%d", &N);
  for ((i) = 0; (i) < (int)(N); (i)++) scanf("%lf", &p[i]);
  double x = 0.0, ans = 0.0;
  for ((i) = 0; (i) < (int)(N); (i)++) {
    x = x * p[i] + p[i];
    ans += 2.0 * x;
    ans -= p[i];
  }
  printf("%.9f\n", ans);
  return 0;
}
