#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
double n, p[100005];
void solve() {
  double ans = 0, g = 0, s = 0, t = 0;
  for (int i = 1; i <= n; i++) {
    t = p[i - 1] * (t + 2 * s) + (1 - p[i - 1]);
    s = p[i - 1] * s + (1 - p[i - 1]);
    g = p[i] * (g + t);
    ans += (1 - p[i + 1]) * g;
  }
  cout << fixed << setprecision(9) << ans << endl;
}
int main() {
  while (cin >> n) {
    memset(p, 0, sizeof(p));
    for (int i = 1; i <= n; i++) {
      scanf("%lf", &p[i]);
    }
    solve();
  }
}
