#include <bits/stdc++.h>
using namespace std;
int n;
double res, cur, x;
int main() {
  for (cin >> n; n--;) {
    cin >> x;
    cur *= x;
    res += 2 * cur + x;
    cur += x;
  }
  printf("%.15lf\n", res);
}
