x = int(input()) y = int(input()) l = int(input()) order_counter = 0 move_counter = 0 rotation_counter = 0 if y >= 0: if y != 0: q, mod = divmod(abs(y),l) if mod == 0: move_counter += q else: move_counter += q + 1 if x != 0: rotaition_counter += 1 q, mod = divmod(abs(x), l) if mod == 0: move_counter += q else: move_counter += q + 1 else: rotaition_counter += 2 q, mod = divmod(abs(y),l) if mod == 0: move_counter += q else: move_counter += q + 1 q, mod = divmod(abs(x), l) if mod == 0: move_counter += q else: move_counter += q + 1 order_counter = rotaition_counter + move_counter print(order_counter)