X = int(input()) Y = int(input()) L = int(input()) Dx = abs(X) Dy = abs(Y) x_steps = (Dx + L - 1) // L if Dx != 0 else 0 y_steps = (Dy + L - 1) // L if Dy != 0 else 0 directions = 0 if x_steps > 0: directions += 1 if y_steps > 0: directions += 1 if directions == 0: print(0) elif directions == 1: if y_steps > 0: print(y_steps) else: print(1 + x_steps) else: print(y_steps + x_steps + 1)