#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  double p[n];
  for (int i = 0; i < n; ++i) cin >> p[i];
  long double res = 0;
  long double tmp = 0;
  for (int i = 0; i < n; ++i) {
    tmp = tmp * p[i] + p[i];
    res += 2 * tmp - p[i];
  }
  cout << setprecision(10) << res << endl;
  return 0;
}
