import Control.Applicative
import Control.Monad
import Data.List

f [n, m] = if n*2>m then 1 else head [q | t <- [n..m], let (q, r) = divMod m t, r == 0]

main = map read . words <$> getLine >>= print . f