#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long double sum = 0, s = 0;
  long double now = 0;
  long double a;
  for (int i = 0; i < n; i++) {
    cin >> a;
    s += a;
    now *= a;
    sum += now * 2;
    now += a;
  }
  cout << fixed << setprecision(20) << sum + s << endl;
}
