#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long double dp[1 << 20];
int main(void) {
  srand(time(0));
  int n;
  cout << fixed << setprecision(7);
  ios_base ::sync_with_stdio(0);
  cin >> n;
  long double ans = 0, cnt = 0, last = 1;
  for (int i = 1; i <= n; ++i) {
    long double p;
    cin >> p;
    cnt = p * (cnt + 2 - last);
    ans += cnt;
    last = 1 - p;
  }
  cout << ans << '\n';
  return 0;
}
