#include <bits/stdc++.h>
using namespace std;
double p[1000005];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> p[i];
  double ans = 0.0, x = 0.0;
  for (int i = 0; i < n; i++) {
    x = x * p[i] + p[i];
    ans += 2.0 * x;
    ans -= p[i];
  }
  printf("%.10lf\n", ans);
  return 0;
}
