#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000000ll + 7ll;
int main() {
  int i, j, n, m;
  double a[100010], l[100010], r[100010];
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  l[0] = r[n + 1] = 0;
  for (i = 1; i <= n; i++) l[i] = (l[i - 1] + 1) * a[i];
  for (i = n; i >= 1; i--) r[i] = (r[i + 1] + 1) * a[i];
  double ans = 0;
  for (i = 1; i <= n; i++) ans += a[i] * (l[i - 1] + 1.0 + r[i + 1]);
  printf("%0.12f", ans);
  return 0;
}
