#include <bits/stdc++.h>
using namespace std;
int main() {
  cout << setprecision(12);
  int n;
  cin >> n;
  double p, q = 0, s = 0, b = 0;
  for (int i = 0; i < n; i++) cin >> p, b = (b + q) * p, s += 2 * b + p, q = p;
  cout << s << endl;
  return 0;
}
