def E(x) return 0 if x >= $k res = 1 6.times do |i| res += E(x + i + 1).to_f / 6.0 end return res end $k = gets.to_i puts E(0)