import math ans = 0 X = int(input()) Y = int(input()) L = int(input()) if Y >= 0 and X == 0: ans += math.ceil(Y/L) elif Y >= 0 and X != 0: ans += math.ceil(Y/L) + math.ceil(abs(X)/L) + 1 elif Y < 0: ans += math.ceil(abs(Y)/L) + math.ceil(abs(X)/L) + 2 print(ans)