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