X = int(input()) Y = int(input()) L = int(input()) count = 0 if Y < 0: count += 2 elif X != 0: count += 1 else: count += 0 co_x = -(-X // L) co_y = -(-Y // L) if co_x < 0: co_x = -(co_x * 1) elif co_y < 0: co_y = -(co_y * 1) count2 = count + co_x + co_y print(count2)