#include <bits/stdc++.h>
using namespace std;
double dp[100005], ans;
int main() {
  int N;
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) {
    double x;
    scanf("%lf", &x);
    dp[i] = (dp[i - 1] + 1) * x;
    ans += (dp[i] - x) * 2 + x;
  }
  printf("%.9lf", ans);
}
