import math x = int(input()) y = int(input()) l = int(input()) c = 0 #ๆ—‹ๅ›ž if y < 0: c += 2 elif x != 0: c += 1 #็งปๅ‹• c += math.ceil(abs(x) / l) c += math.ceil(abs(y) / l) print(c)