-- yukicoder My Practice -- author: Leonardone @ NEETSDKASU main = readLn >>= print . f where f x = g 3 where g i | x < i * i = x | mod x i == 0 = i | otherwise = g (i + 1)