#include<iostream>
#include<iomanip>
using namespace std;
typedef pair<int,int> Pt;
typedef pair<int,Pt> P;
#define fr first
#define sc second
#define INF (1 << 26)
#define FOR(i,b,n) for(int i = (b) ; i < (n) ; ++i)
#define rep(i,n) FOR(i,0,n)
int main(){
  double dp[101000],ans[101000];
  dp[1] = 1.0;
  FOR(i,1,100001){
    double ogmm = dp[i] , nkmr = 1.0;
    rep(j,/*about*/10){
      dp[i + j + 1] += ogmm * ( 1.0 - nkmr );
      ans[i + j] += ogmm * nkmr;
      ogmm *= nkmr;
      nkmr /= 2;
    }
  }
  FOR(i,1,100001) ans[i] += ans[i-1];
  int n;
  while(cin >> n && n)
    cout << fixed << setprecision(3) <<  ans[n] << endl;
}