
private fun isPrime(value: Int) = (2 until value).none { value % it == 0 }

fun main(args: Array<String>) {
    val X = readLine()!!.toInt()

    val firstPrime = (X..Int.MAX_VALUE).first { isPrime(it) }

    println(firstPrime)
}