#include <bits/stdc++.h>
using namespace std;
int toInt(string s) {
  istringstream sin(s);
  int t;
  sin >> t;
  return t;
}
template <class T>
string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
template <class T>
void chmin(T &t, T f) {
  if (t > f) t = f;
}
template <class T>
void chmax(T &t, T f) {
  if (t < f) t = f;
}
int n;
double p[100010];
double el[100010];
double ans;
void solve() {
  int i;
  el[n] = 0;
  for (i = n - 1; i >= 0; i--) {
    el[i] = p[i] * (el[i + 1] + 1);
    ans += el[i];
  }
}
int main() {
  cin >> n;
  int i, j;
  for (i = (0); i < (n); i++) cin >> p[i];
  solve();
  reverse(p, p + n);
  solve();
  for (i = (0); i < (n); i++) ans -= p[i];
  printf("%.08lf\n", ans);
  return 0;
}
