D=100000
$dp = Array.new(D).map{ Array.new(32, 0.0) }
$ans = Array.new(D+1)
def solve n
  $dp[0][1] = 1.0
  $ans[1] = 1.0
  ps = 1.0
  for d in 1...n
    p = 1.0
    for i in 1...32
      pa = $dp[d-1][i-1]*(1-p)
      pb = $dp[d-1][i-1]*p
      $dp[d][0] += pa
      $dp[d][i] += pb
      ps += pb
      p/=2
    end
    $ans[d+1] = ps
  end
end

solve D

n=nil
puts "%.5f" % $ans[n] while (n=gets.chomp.to_i)!=0