x = gets.to_i y = gets.to_i l = gets.to_i c = 0 c += 1 if x != 0 c += 1 if y < 0 c += (x/l).ceil c += (y/l).ceil puts c