#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  double inp[n];
  for (int i = 0; i < n; i++) {
    double a;
    cin >> a;
    inp[i] = a;
  }
  double pro[n];
  pro[0] = inp[0];
  for (int i = 1; i < n; i++) {
    pro[i] = pro[i - 1] * inp[i] + inp[i];
  }
  double ans = 0;
  for (int i = 0; i < n; i++) {
    ans += inp[i];
    ans += (pro[i] - inp[i]) * 2;
  }
  printf("%.9f\n", ans);
}
