#include <iostream>
#include <iomanip>

#define rep(i, n) for(int i = 0; i < n; i++)

using namespace std;

double dp[100005][15];
double two[105];

double solve(int n, int k){
  if(n == 0) return 0;
  double& d = dp[n][k];
  if(d != -1.0) return d;
  return d = two[k] * (1.0 + solve(n-1, min(k+1, 10))) + (1.0 - two[k]) * solve(n-1, 0);
}

int main(){

  int n;
  cout << fixed << setprecision(10);

  rep(i, 100005) rep(j, 15) dp[i][j] = -1.0;
  double tmp = 1.0;
  rep(i, 15) {
    two[i] = tmp;
    tmp *= 0.5;
  }

  while(cin >> n){
    if(n == 0) break;
    cout << solve(n, 0) << endl;
  }

  return 0;
}