#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 2;
int n, T, t = 1, m, i, j, k;
long double p[maxn], dp0[maxn], dp1[maxn], dp2[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> p[i];
  dp0[0] = 1;
  for (int i = 1; i <= n; i++)
    dp0[i] = p[i] * (dp0[i - 1]) + ((double)1 - p[i]);
  for (int i = 1; i <= n; i++) dp1[i] = p[i] * (dp1[i - 1] + dp0[i + 1]);
  for (int i = 1; i <= n; i++)
    dp2[i] = p[i] * (dp2[i - 1] + (double)2 * dp1[i - 1] + dp0[i - 1]) +
             ((double)1 - p[i]) * dp2[i - 1];
  cout << fixed << setprecision(10) << dp2[n];
}
