#include <bits/stdc++.h>
using namespace std;
const int INF = 2000000000;
const int MOD = 1000000007;
const long long L_MAX = 9223372036854775807;
const int I_MAX = 2147483647;
int main(int argc, const char **argv) {
  int N;
  double Res, P, lcl;
  while (cin >> N) {
    Res = lcl = 0.0;
    for (int i = 1; i <= N; ++i) {
      cin >> P;
      lcl = (lcl * P) + P;
      Res += 2 * lcl - P;
    }
    cout << fixed << setprecision(9) << Res << endl;
  }
  return 0;
}
