#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n;
double f1[N], f2[N], f3[N], a[N], ans;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    f1[i] = a[i] * (f1[i - 1] + 1);
    f2[i] = a[i] * (f2[i - 1] + 1 + 2 * f1[i - 1]);
    f3[i] = a[i] * (f3[i - 1] + 3 * f2[i - 1] + 3 * f1[i - 1] + 1);
  }
  for (int i = 1; i <= n + 1; ++i) ans += (1 - a[i]) * f2[i - 1];
  printf("%.10lf\n", ans);
  return 0;
}
