x, y, l = io.read("*n"), io.read("*n"), io.read("*n") turn = 1; if (y > 0) and (x == 0) then turn = 0 end if (y < 0) then turn = 2 end fw = function(n) return math.ceil(math.abs(n)/l) end print(turn + fw(x) + fw(y))