#include <bits/stdc++.h>
using namespace std;
double wp[100010], lp[100010];
double dp[3][100010];
double find(int n) {
  dp[0][n] = dp[1][n] = wp[n];
  dp[2][n] = 1;
  for (int i = n - 1; i >= 0; i--) {
    dp[0][i] = (wp[i] * (dp[0][i + 1] + 2 * dp[1][i + 1] + dp[2][i + 1]));
    dp[0][i] += (lp[i] * (dp[0][i + 1]));
    dp[1][i] = (wp[i] * (dp[1][i + 1] + 1));
    dp[2][i] = 1;
  }
  return dp[0][0];
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", &wp[i]), lp[i] = 1 - wp[i];
  printf("%.10lf\n", find(n - 1));
}
