main :: IO ()
main = do
  (a:b:n:_) <- map read . words <$> getLine :: IO [Int]
  let xs = [n-b..n]
  print . maximum $ map (result a b) xs

result :: Int -> Int -> Int -> Int
result a b x = (a*x) `div` b - a * (x `div` b)
