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