#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  double ans, last, dp, p;
  dp = 0;
  cin >> last;
  ans = last;
  for (int i = 1; i < n; ++i) {
    cin >> p;
    dp = (dp + last) * p;
    ans += 2 * dp + p;
    last = p;
  }
  printf("%.15f\n", ans);
  return 0;
}
