#include <bits/stdc++.h>   #pragma comment(linker,  /STACK:100000000,100000000 )   using namespace std;   const long long inf = 1e9 + 7;   const long long mod = 1e9 + 7;   const double eps = 1e-9;   const double PI = 2 * acos(0.0);   const double E = 2.71828;   int main(void) {     long long n;     cin >> n;     double ans = 0, e = 0;     for (int i = 0; i < n; i++) {       double temp;       cin >> temp;       ans += temp * (2.0 * e + 1);       e = temp * (e + 1);     }     cout << setprecision(8) << fixed << ans << endl;     return 0;   }   