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