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