import math x = int(input()) y = int(input()) l = int(input()) c = 0 if y > 0 and x == 0: c += math.ceil(y / l) elif y > 0 and x != 0: c += math.ceil(y / l) c += 1 + abs(math.ceil(x / l)) elif y < 0 and x == 0: c += 2 + math.ceil(y / l) elif y < 0 and x != 0: c += 1 + abs(math.ceil(x / l)) c += 1 - math.ceil(y / l) elif y == 0 and x != 0: c += 1 + abs(math.ceil(x / l)) print(c)