#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, w = 0;
  char c = getchar();
  while (!isdigit(c)) w |= c == '-', c = getchar();
  while (isdigit(c)) x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  return w ? -x : x;
}
namespace star {
int n;
double f, len;
inline void work() {
  n = read();
  double p;
  while (n--) {
    scanf("%lf", &p);
    f = (f - len * len + (len + 1) * (len + 1)) * p + f * (1 - p);
    len = p * (len + 1);
  }
  printf("%.8lf", f);
}
}  // namespace star
signed main() {
  star::work();
  return 0;
}
