#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
double dp[maxn];
double ans = 0;
int main() {
  int n;
  cin >> n;
  dp[0] = 0;
  for (int i = 1; i <= n; i++) {
    double p;
    cin >> p;
    dp[i] = p * dp[i - 1] + p;
    ans += (2 * dp[i - 1] + 1) * p;
  }
  printf("%.10lf\n", ans);
  return 0;
}
