#include <bits/stdc++.h>
int main() {
  static double pp[100000];
  int n, i;
  double ans, p;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%lf", &pp[i]);
  ans = 0, p = 0;
  for (i = 0; i < n; i++) ans += p = (p + 1) * pp[i];
  ans *= 2;
  for (i = 0; i < n; i++) ans -= pp[i];
  printf("%f\n", ans);
  return 0;
}
