import Data.List

solve a b n = last . sort . map f $ [1..n]
  where
    f x = floor arg1 - (a * (floor arg2))
      where
        arg1 = (toDouble a) * (toDouble x) / (toDouble b)
        arg2 = (toDouble x) / (toDouble b)

toDouble :: Int -> Double
toDouble x = fromInteger $ toInteger x



main = do
  [a,b,n] <- map read . words <$> getLine :: IO [Int]
  putStrLn . show $ solve a b n
