isPrime :: Int -> Bool
isPrime num = null(filter (\x -> num `mod` x == 0) [2..floor(sqrt(fromIntegral num))])

findFirstPrime :: Int -> Int
findFirstPrime num = head(filter isPrime [num..])

main = do
    x <- readLn :: IO Int
    let ans = findFirstPrime x
    putStrLn $ show ans
