#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  double p, ans = 0, sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> p;
    ans += (sum * 2 + 1) * p;
    sum = (sum + 1) * p;
  }
  printf("%.10f\n", ans);
}
