x = int(input()) y = int(input()) l = int(input()) count = 0 if y < 0: count += 2 elif x >= 1 or x < 0: count += 1 x = abs(x) y = abs(y) if x <= l and not x == 0: count += 1 elif x % l == 0: count += x / l print(count) else: count += x // l + x % l if y <= l and not y == 0: count += 1 elif y % l == 0: count += y / l else: count += y // l + y % l print(int(count))