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