toInt x = read x :: Int
toFloat x = read x :: Float

func :: Float -> Float -> Int -> Int
func a b x = floor m
     where
          m =  a * (xb - fromIntegral (floor xb))
          xb = (fromIntegral x) / b

main = do
     abn <- map toInt . words <$> getLine
     let a = fromIntegral $ head abn
         b = fromIntegral $ abn !! 1
         n = last abn
     print $ maximum $ map (func a b) [1..n]