#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
double pfxE[N], sfxE[N], p[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", &p[i]);
  double ans = 0, E = 0;
  for (int i = 1; i <= n; i++) E = (1 + E) * p[i], ans += E;
  E = 0;
  for (int i = n; i >= 0; i--) E = (1 + E) * p[i], ans += E - p[i];
  printf("%.10f\n", ans);
  return 0;
}
