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