ex = Array.new(100001){0.0}
pr = Array.new(100001){0.0}
ex[1] = pr[1] = 1.0
(2..100000).each{|i|
  pr[i] = pr[i-1] ** 2 * 0.5 + (1 - pr[i-1])
  ex[i] = ex[i-1] + pr[i]
}

loop{
  n = gets.to_i
  break if n==0
  puts "%.15f" % ex[n]
}
