#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void amin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
inline void amax(T &x, U y) {
  if (x < y) x = y;
}
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= 1000000007;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % 1000000007;
    a = a * a % 1000000007;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  long long i, j, n, m;
  cin >> n;
  long double a[n + 2];
  a[0] = 0;
  a[n + 1] = 0;
  for (int i = 1; i < n + 1; i++) cin >> a[i];
  long double ans = 0;
  long double sqi = 0, li = 0, consi = 0;
  for (int i = 1; i < n + 1; i++) {
    sqi = (sqi + consi + 2.0 * li + (1.0 - a[i - 1])) * a[i];
    li = (li + consi + (1.0 - a[i - 1])) * a[i];
    consi = (consi + (1.0 - a[i - 1])) * a[i];
    ans = sqi * (1.0 - a[i + 1]) + ans;
  }
  cout << fixed << setprecision(10) << ans;
  return 0;
}
