#include <bits/stdc++.h>
using namespace std;
long double ans, p, x;
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%Lf", &p);
    ans += (2 * x + 1.0) * p;
    x = (x + 1.0) * p;
  }
  printf("%.10Lf\n", ans);
  return 0;
}
