#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  double exp, ans, pi;
  exp = ans = 0.0;
  for (int i = 0; i < n; i++) {
    scanf("%lf", &pi);
    exp = exp * pi + pi;
    ans = ans + 2 * exp - pi;
  }
  printf("%.12lf\n", ans);
  return 0;
}
