if __name__ == '__main__': x = int(input()) y = int(input()) l = int(input()) c = 0 if x != 0: c += (abs(x) - 1) // l + 1 if y != 0: c += (abs(y) - 1) // l + 1 if y < 0: c += 2 else: if x != 0: c += 1 print(c)