#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T __cin() {
  T ret;
  cin >> ret;
  return ret;
}
int main() {
  double aa = 0, bb = 0, cc = 1, k = 1;
  double ans = 0;
  int n = 0;
  cin >> n;
  for (__typeof(n) i = 0; i < (n); i++) {
    double p;
    scanf("%lf", &p);
    ans += (1 - p) * aa;
    aa = p * (aa + 2 * bb + cc);
    bb = p * (bb + cc);
  }
  ans += aa;
  printf("%.10lf\n", ans);
  return 0;
}
