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