X, Y, L = [int(input()) for _ in range(3)] f = lambda X: -(-(abs(X))//L) print(f(X) + f(Y) + [X != 0, 2][Y < 0])