#include <bits/stdc++.h>
using namespace std;
int i, j, k, m, n, l;
double a[100000 + 10], s[100000 + 10], p[100000 + 10];
int main() {
  while (cin >> n) {
    double p = 0, ans = 0;
    for (int i = (1); i <= (n); ++i) {
      scanf("%lf", &a[i]);
      ans += a[i] * p * 2 + a[i];
      p = (p + 1) * a[i];
    }
    printf("%.10lf\n", ans);
  }
  return 0;
}
