w,d = gets.split("\n").map(&:to_i) while d > 0 do x = w / (d * d) w -= x d -= 1 end puts x