main = getLine >>= print . f . head . map read . words where f n = head [ div n i | i <- [2..n], mod n i == 0]