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