#include <bits/stdc++.h>
const long long inf = 0x3f3f3f3f3f3f3f3LL;
const long long mod = (long long)1e9 + 7;
using namespace std;
template <class T>
void smin(T& a, T val) {
  if (a > val) a = val;
}
template <class T>
void smax(T& a, T val) {
  if (a < val) a = val;
}
const long long N = 1e5 + 10;
long long n;
double p[N];
void solve() {
  cin >> n;
  for (long long i = 1; i <= n; ++i) {
    cin >> p[i];
  }
  double expectedLen = 0, expectedScore = 0;
  for (long long i = 1; i <= n; ++i) {
    expectedScore = (1 - p[i]) * expectedScore +
                    p[i] * (expectedScore + 1 + 2 * expectedLen);
    expectedLen = p[i] * 1 + p[i] * expectedLen;
  }
  cout << fixed << setprecision(15);
  cout << expectedScore;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
    cout << '\n';
  }
  return 0;
}
