x = int(input()) y = int(input()) step = int(input()) if x == 0: count = 0 elif y > 0: count = 1 else: count = 2 if abs(x)%step == 0: count += abs(x)/step else: count += int(abs(x)/step) + 1 if abs(y)%step == 0: count += abs(y)/step else: count += int(abs(y)/step) + 1 print(int(count))