#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  double a[n], b[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  b[0] = a[0];
  for (int i = 0; i < n; i++) b[i] = (b[i - 1] + 1) * a[i];
  double sum = 0;
  for (int i = 0; i < n; i++) sum += 2 * b[i] - a[i];
  printf("%.15lf\n", sum);
  return 0;
}
