import math x = int(input()) y = int(input()) max_move_distance = int(input()) ans = 0 if y > 0: ans += math.ceil(y / max_move_distance) if x != 0: ans += 1 ans += math.ceil(abs(x) / max_move_distance) elif y == 0: if x != 0: ans += 1 ans += math.ceil(abs(x) / max_move_distance) else: if x != 0: ans += math.ceil(abs(x) / max_move_distance) ans += 2 ans += math.ceil(x / max_move_distance) print(ans)