import math x = int(input()) y = int(input()) l = int(input()) a = math.ceil(abs(x) / l) b = math.ceil(abs(y) / l) if y == 0: if x == 0: c = 0 else: c = a + 1 elif y > 0: if x == 0: c = b else: c = a + b + 1 else: c = a + b + 2 print(c)