#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
double ans, cnt, s;
double p[maxn];
int n;
void solve() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", p + i);
  p[0] = 0;
  for (int i = 1; i <= n; i++) {
    cnt = (cnt + s * 2 + 1 - p[i - 1]) * p[i];
    s = (s + 1 - p[i - 1]) * p[i];
    ans += cnt;
  }
  printf("%.10lf", ans);
}
int main() { solve(); }
