class Problem0048: def solve(this): x = int(input()) y = int(input()) l = int(input()) res = 0 if x != 0: res += 1 if y < 0: res += 2 x = abs(x) y = abs(y) ax = x // l if x % l != 0: ax += 1 ay = y // l if y % l != 0: ay += 1 res += ax + ay print(res) if __name__ == "__main__": problem = Problem0048() problem.solve()