getMinimum :: Integral a => a -> a getMinimum n = head [x | x <- [3 ..], mod n x == 0] main :: IO () main = print . getMinimum =<< readLn