/* --- author: dxm --- */
#include<bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;

#define INF 1e9
#define Inf 1e18
#define rep(i,n) for(int (i)=0;(i)<n;i++)
#define REP(i,n) for(int (i)=1;(i)<=n;i++)
#define mp make_pair
#define pb push_back
#define fst first
#define snd second
typedef long long ll;
typedef double db;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;

void qread(int &x){
	int neg=1;x=0;
	char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')neg=-1;c=getchar();}
	while(c>='0'&&c<='9')x=10*x+c-'0',c=getchar();
	x*=neg;
}

const int maxn=100005;
int n,m;
db p[maxn],q[maxn],dp[maxn];
int len[maxn];

int main(){
#ifdef FILE
	freopen("FILE.in","r",stdin);
	freopen("FILE.out","w",stdout);
#endif
	while(scanf("%d",&n)&&n>0){
		m=0;
		REP(i,n){
			scanf("%lf",&p[i]);
			if(m&&p[i]>0.999&&q[m]>0.999)len[m]++;
			else q[++m]=p[i],len[m]=1; 
		}
		dp[m+1]=0;
		for(int i=m;i>=1;i--){
			db cur=0;
			dp[i]=INF;
			for(int j=i;j<=i+100&&j<=m;j++){
				cur*=1/q[j];
				cur+=len[j]*(1/q[j]);
				dp[i]=min(dp[i],cur+dp[j+1]);
			}
			dp[i]++;
		}
		printf("%.10lf\n",dp[1]-1.0);
	}
#ifdef TIME
	printf("Running Time = %d ms\n",int(clock()*1000.0/CLOCKS_PER_SEC));
#endif
	return 0;
}

/*
Input:
-----------------
Output:
*/

