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