#include <bits/stdc++.h>
using namespace std;
int N;
double s = 0, P[100001];
int main() {
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> P[i];
    s -= P[i];
  }
  double dp = 0.0;
  for (int i = 0; i < N; i++) s += 2.0 * (dp = (1 + dp) * P[i]);
  printf("%.10f\n", s);
  return 0;
}
