#include <bits/stdc++.h>
using namespace std;
int n;
double arr[100005], dp[100005];
void Readinput() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) cin >> arr[i];
}
void solve() {
  int i, j;
  double ans = 0, sum = 0;
  dp[0] = 0;
  arr[0] = 0;
  for (i = 1; i <= n; i++) {
    dp[i] = (dp[i - 1] + arr[i - 1]) * arr[i];
    ans += dp[i];
    sum += arr[i];
  }
  ans *= 2;
  ans += sum;
  printf("%.8lf\n", ans);
}
int main() {
  Readinput();
  solve();
  return 0;
}
