#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int mod = 1e9 + 7;
long double a[N];
long double pre[N];
long double ans;
int main() {
  cout << fixed << setprecision(19);
  int n;
  cin >> n;
  long double s = 0.0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    s += a[i];
  }
  for (int j = 1; j <= n; j++) {
    pre[j] += (pre[j - 1] + a[j - 1]) * a[j];
    ans += pre[j];
  }
  cout << ans * 2.0 + s;
}
