#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  double sum = 0, a, p = 1;
  cin >> n;
  while (n--) {
    scanf("%lf", &a);
    sum += p * a;
    p = 1 + (1 + p) * a;
  }
  printf("%.15lf\n", sum);
  return 0;
}
