#include <bits/stdc++.h>
using namespace std;
const int N = 1e+5 + 5;
long double p[N], ans, b[N], s[N], k[N];
int n;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> p[i];
  for (int i = n; i >= 1; i--) {
    s[i] = s[i + 1] * p[i] + p[i];
    k[i] = k[i + 1] * p[i] + s[i];
    b[i] = p[i] * (b[i + 1] + 2 * k[i + 1]) + s[i];
    ans += (1 - p[i - 1]) * (b[i] - p[i] * b[i + 1]);
  }
  cout << setprecision(9) << fixed << ans;
}
