#include <bits/stdc++.h>
using namespace std;
void JIZZ() {
  cout << "";
  exit(0);
}
const long double PI = 3.14159265358979323846264338327950288;
const long double eps = 1e-8;
const long long mod = 1e9 + 7;
long double prob, a[100005], pre;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    prob += a[i];
    prob += a[i] * pre * 2;
    pre = pre * a[i] + a[i];
  }
  cout << fixed << setprecision(10) << prob << endl;
}
