#include <bits/stdc++.h>
using namespace std;
double dp[100010], A[100010];
int main() {
  dp[0] = 0;
  int n;
  cin >> n;
  double g = 0;
  for (int i = 1; i <= n; i++) {
    cin >> A[i];
    g += A[i];
  }
  A[0] = 0;
  for (int i = 1; i <= n; i++) dp[i] = (dp[i - 1] + A[i - 1]) * A[i];
  double ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += 2 * dp[i];
  }
  printf("%.17lf", ans + g);
}
