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