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