#include<iostream>
#include<cmath>
#include<vector>
#include<string>
#include<cstdio>
typedef unsigned long long ull;
#define rep(i,a) for(int i=0;i<a;i++)
#define loop(i,a,b) for(int i=a;i<b;i++)
using namespace std;
const double eps = 1e-10;
const double pi = acos(-1);
const double inf = (int)1e8;

const int N = 100000;
const int M = 11;

double dp[N][M] , data[N+1] , ans[N],sum;
int n;

int main(void){
  data[0] = 1.0;
  loop(i,1,M+1)data[i] = data[i-1] * 0.5;
  fill(dp[0],dp[N],0.0);
  dp[0][0] = 1.0;
  rep(i,N){
    rep(j,M){
      if(dp[i][j] > 0.0){
	sum += dp[i][j] * data[j];
	dp[i+1][0] += dp[i][j] * (1.0 - data[j]);
	dp[i+1][j+1] += dp[i][j] * data[j];
      }
    }
    ans[i] = sum;
  }
  while(cin>>n,n)printf("%.3f\n",ans[n-1]);
  return 0;
}