X = int(input()) Y = int(input()) L = int(input()) count = 0 if Y >= 0: if X != 0: count += 1 else: count += 2 X = abs(X) Y = abs(Y) count = count + int(X / L) + int(Y / L) if X % L != 0: count += 1 if Y % L != 0: count += 1 print(count)