X, Y, L = [int(input()) for _ in range(3)] C = 0 C += 2 if Y < 0 else [0, 1][X != 0] C += -(-abs(X)//L) C += -(-abs(Y)//L) print(C)