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