#include <bits/stdc++.h>
using namespace std;
long long n;
double kq, s, x;
int main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> x;
    s *= x;
    kq += 2 * s + x;
    s += x;
  }
  printf("%.15lf", kq);
}
