// AOJ 1056: Ben Toh
// 2017.12.15 bal4u@uu

#include <stdio.h>
#include <string.h>
#include <math.h>

double dp[100001][21];
double s[100001];

int main()
{
	int i, j;
	double t;

	dp[1][1] = 1;
	for (i = 1; i <= 100000; i++) for (j = 0; j <= 20; j++) {
		dp[i+1][j+1] = dp[i][j] * pow(0.5, j);
		dp[i+1][0]  += dp[i][j] * (1.0 - pow(0.5, j));
	}

	for (i = 0; i <= 100000; i++) {
		t = 0;
		for (j = 1; j <= 20; j++) t += dp[i+1][j];
		s[i+1] = t + s[i];
	}
  
	while (scanf("%d", &i) && i > 0) printf("%.8lf\n", s[i]);
	return 0;
}