import math X = int(input()) Y = int(input()) L = int(input()) if X == 0: Nx = 0 else: Nx = (abs(X) + L - 1) // L if Y == 0: Ny = 0 else: Ny = (abs(Y) + L - 1) // L total_forward_moves = Nx + Ny if X == 0 and Y == 0: print(0) elif X == 0: if Y > 0: print(total_forward_moves) else: print(total_forward_moves + 2) elif Y == 0: print(total_forward_moves + 1) else: if Y > 0: print(total_forward_moves + 1) else: print(total_forward_moves + 2)