#include <bits/stdc++.h>
int n;
int main() {
  int i;
  double mult = 0, resp = 0, p;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%lf", &p);
    resp += p * (1 + 2 * mult);
    mult = (mult + 1) * p;
  }
  printf("%.15lf\n", resp);
  return 0;
}
