#include <bits/stdc++.h>
using namespace std;
int n;
double p, e[100010], dp[100010];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lf", &p);
    e[i] = p * (e[i - 1] + 1);
    dp[i] = dp[i - 1] + (2 * e[i - 1] + 1) * p;
  }
  printf("%.9lf", dp[n]);
}
