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