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