#include <bits/stdc++.h>
using namespace std;
const long long Maxn = 1e5 + 10;
double p[Maxn], dp[Maxn], dp2[Maxn], sum[Maxn];
int main() {
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> p[i];
  for (long long i = 1; i <= n; i++) dp2[i] = (dp2[i - 1] + 1) * p[i];
  for (long long i = 1; i <= n; i++) {
    dp[i] = dp[i - 1] * (1 - p[i]) + (dp[i - 1] - dp2[i - 1] * dp2[i - 1] +
                                      (dp2[i - 1] + 1) * (dp2[i - 1] + 1)) *
                                         p[i];
  }
  printf("%.6lf", dp[n]);
  return 0;
}
