#include <bits/stdc++.h>
const int INF = 0x3f3f3f3f;
using namespace std;
int i, j, k, l;
int n;
double ans, now, last;
int main() {
  int i, j;
  double p;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%lf", &p);
    now = now * p + p * last;
    ans += p + now * 2;
    last = p;
  }
  printf("%.12f", ans);
}
