import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines X,Y,L = map(int,read().split()) def solve(X,Y,L): if X == 0 and Y == 0: return 0 if X == 0 and Y > 0: return (Y + L - 1) // L if X == 0 and Y < 0: return (-Y + L - 1) // L + 2 # X != 0 if X < 0: X = -X x = (X + L - 1) // L if Y >= 0: return 1 + x + (Y + L - 1) // L return 2 + x + (-Y + L - 1) // L answer = solve(X,Y,L) print(answer)