#include <bits/stdc++.h>
using namespace std;
int N, M, K;
double p[100005];
int main() {
  scanf("%d", &N);
  double ret = 0;
  for (int i = 0; i < N; i++) {
    scanf("%lf", p + i);
    ret += p[i];
  }
  double dp = 0;
  for (int i = 0; i < N; i++) {
    dp = (dp + 1) * p[i];
    ret += (dp - p[i]) * 2;
  }
  printf("%.10lf\n", ret);
  return 0;
}
