x, y, l = [int(input()) for i in range(3)] cnt = 0 if x != 0: if y >= 0: cnt += 1 else: cnt += 2 cnt += abs(-abs(x) // l + -abs(y) // l) print(cnt)