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