x, y, l = io.read("*n"), io.read("*n"), io.read("*n") print(((y<0) and 2 or (x~=0) and 1 or 0) + math.ceil(math.abs(x)/l) + math.ceil(math.abs(y)/l))