defmodule Main do
  def main do
    [a, b, n] =
      IO.gets("")
      |> String.trim()
      |> String.split()
      |> Enum.map(&String.to_integer/1)
    solve(a, b, n, 10000000000000000000)
    |> IO.puts()
  end
  
  def solve(a, b, x, max) when x < 0, do: max
  def solve(a, b, x, max) do
    tmp = floor(a * x / b) - a * floor(x/ b)
    #IO.inspect({tmp, x}, label: :tmp)
    if tmp < max do
      solve(a, b, -1, tmp)
    else
      solve(a, b, x - 1, max)
    end
  end
end