#include <bits/stdc++.h>
using namespace std;
double sum_of_p;
double cur_ans;
double ans;
int main() {
  int n;
  double p, q;
  cin >> n;
  sum_of_p = 1.0;
  cur_ans = -1.0;
  for (int i = 0; i < n; i++) {
    cin >> p;
    q = 1.0 - p;
    cur_ans = (cur_ans + sum_of_p * 2.0) * p;
    ans += cur_ans;
    cur_ans = cur_ans - q;
    sum_of_p = sum_of_p * p + q;
  }
  cout << fixed << setprecision(8) << ans;
  return 0;
}
