import Control.Monad main = do [n, k] <- liftM (map read . words) getLine let f x | n `mod` x == 0 && n `div` x >= k = x | otherwise = 1 res = maximum . map f $ [1..n] in print res