EPS = 1e-12
MAX = 100000
ok = [0.0] * 32
ng = 0.0
ok[0] = 1.0

ans = [0.0] * (MAX + 1)
ans[1] = 1.0
sum = 1.0
(2..MAX).each do |i|
  cur_ok = [0.0] * 32
  cur_ok[0] = ng
  sum += ng
  cur_ng = 0.0
  p = 0.5
  (0...i).each do |k|
    cur_ng += ok[k] * (1 - p)
    okp = ok[k] * p
    break if okp > 0 && okp < EPS
    cur_ok[k + 1] = okp
    sum += okp
    p /= 2
  end
  ans[i] = sum
  ok = cur_ok
  ng = cur_ng
end

while n = gets.to_i
  break if n == 0
  printf "%.8f\n" % ans[n]
end