#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  double m = 0;
  double ans = 0;
  for (int i = 0; i < n; ++i) {
    double a;
    cin >> a;
    ans += 2 * m * a + a;
    m = m * a + a;
  }
  printf("%.12lf\n", ans);
  return 0;
}
