X = int(input()) Y = int(input()) L = int(input()) cnt = abs(X) // L + abs(Y) // L if X % L != 0: cnt += 1 if Y % L != 0: cnt += 1 if Y < 0: cnt += 2 elif X != 0: cnt += 1 print(cnt)