#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int lzx = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -f;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    lzx = lzx * 10 + c - '0';
    c = getchar();
  }
  return lzx * f;
}
double P[100001], len1[100001], len[100001], ans;
int main() {
  int n = read();
  for (register int i = 1; i <= n; i++) scanf("%lf", &P[i]);
  for (register int i = 1; i <= n; i++) {
    len[i] = (len[i - 1] + 1) * P[i];
    ans += (1.0 + 2.0 * len[i - 1]) * P[i];
  }
  printf("%.8lf\n", ans);
  return 0;
}
