#include <stdio.h>

double kakuritu_table[21];
double memo[100010][21];
char visited[100010][21];

double tansaku(int rest,int renzoku) {
	double result=0;
	if(rest<=0)return 0;
	if(visited[rest][renzoku])return memo[rest][renzoku];
	if(renzoku<20)result+=(1+tansaku(rest-1,renzoku+1))*kakuritu_table[renzoku];
	result+=tansaku(rest-1,0)*(1-kakuritu_table[renzoku]);
	visited[rest][renzoku]=1;
	memo[rest][renzoku]=result;
	return result;
}

int main(void) {
	int n;
	kakuritu_table[0]=1;
	for(n=1;n<=20;n++)kakuritu_table[n]=kakuritu_table[n-1]/2;
	while(scanf("%d",&n)==1 && n>0) {
		printf("%f\n",tansaku(n,0));
	}
	return 0;
}