import java.util.*

fun main(args: Array<String>) {
    val scn = Scanner(System.`in`)
    val number: Int = scn.nextLine().toInt()

    val sameNumber: List<Int> = (1..9).toList().map { it -> (it.toString() + it.toString() + it.toString()).toInt() }.filter { it >= number }.toList()
    println(sameNumber[0])

}