#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

int main(){
  int N;
  while(cin>>N && N){
    double dp_exp[11] = {};
    double dp_pos[11] = {};
    dp_pos[0] = 1;
    REP(i, N){
      double next_exp[11] = {};
      double next_pos[11] = {};
      REP(j, 10){
        next_pos[j + 1] += dp_pos[j] * pow(0.5, j);
        next_pos[0] += dp_pos[j] * (1.0 - pow(0.5, j));
        next_exp[j + 1] += (dp_exp[j] + 1) * dp_pos[j] * pow(0.5, j);
        next_exp[0] += dp_exp[j] * dp_pos[j] * (1.0 - pow(0.5, j));
      }
      REP(j, 10) if(next_pos[j] != 0) next_exp[j] /= next_pos[j];
      memcpy(dp_pos, next_pos, sizeof(dp_pos));
      memcpy(dp_exp, next_exp, sizeof(dp_exp));
    }
    double ans = 0;
    REP(i, 10) ans += dp_exp[i] * dp_pos[i];
    printf("%.8lf\n", ans);
  }
  return 0;
}