#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void checkmax(T &x, T y) {
  if (x < y) x = y;
}
template <class T>
inline void checkmin(T &x, T y) {
  if (x > y) x = y;
}
template <class T>
inline T Min(T x, T y) {
  return (x > y ? y : x);
}
template <class T>
inline T Max(T x, T y) {
  return (x < y ? y : x);
}
template <class T>
T Abs(T a) {
  return a > 0 ? a : (-a);
}
template <class T>
inline T lowbit(T n) {
  return (n ^ (n - 1)) & n;
}
template <class T>
inline int countbit(T n) {
  return (n == 0) ? 0 : (1 + countbit(n & (n - 1)));
}
double dp, ans, te, pre;
int n;
int main() {
  while (scanf("%d", &n) == 1) {
    ans = 0;
    pre = 0;
    dp = 0;
    for (int i = 1; i <= (int)(n); ++i) {
      scanf("%lf", &te);
      ans += te;
      dp = dp * te + pre * te;
      ans += dp * 2;
      pre = te;
    }
    printf("%.10lf\n", ans);
  }
  return 0;
}
