import math x = int(input()) y = int(input()) l = int(input()) distance = 0 distance += math.ceil(abs(x) / l) distance += math.ceil(abs(y) / l) print(distance) if x < 0 and y < 0: distance += 2 else: if x < 0: distance += 1 if y < 0: distance += 2 print(distance)