x_target = int(input()) y_target = int(input()) speed = int(input()) count = 0 if x_target != 0: count += 1 if y_target < 0: count += 1 elif y_target < 0: count += 2 if x_target % speed != 0: count += 1 count += (abs(x_target) // speed) if y_target % speed != 0: count += 1 count += (abs(y_target) // speed) print(count)