#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n;
double p[N];
int main() {
  cin >> n;
  double ans = 0.0, sum = 0.0;
  for (int i = 1; i <= n; i++) cin >> p[i];
  for (int i = n; i; i--) {
    ans += p[i] * (2 * sum + 1);
    sum = p[i] * (1 + sum);
  }
  cout << fixed << setprecision(12) << ans;
}
