#include <bits/stdc++.h>
const double eps = 1e-9;
const double pi = acos(-1);
const int oo = 1000000000;
const int mod = 1000000007;
const double E = 2.7182818284590452353602874713527;
using namespace std;
int main() {
  int n;
  double s = 0, t = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    double a = 0;
    scanf("%lf", &a);
    t = (t + 1) * a;
    s += 2 * t - a;
  }
  printf("%.12lf\n", s);
  return 0;
}
