X = int(input()) Y = int(input()) L = int(input()) step_x = abs(X) // L if abs(X) % L == 0 else abs(X) // L + 1 step_y = abs(Y) // L if abs(Y) % L == 0 else abs(Y) // L + 1 if Y >= 0 and X == 0: rotate = 0 elif Y >= 0: rotate = 1 else: rotate = 2 print(step_x + step_y + rotate)