fun main(args: Array<String>) {
    val N = readInputLine().toInt()
    
    if (N <= N / 100 * 100 + N / 100 * 10 + N / 100) {
        println(N / 100 * 100 + N / 100 * 10 + N / 100)
    } else {
        println((N / 100 + 1) * 100 + (N / 100 + 1) * 10 + (N / 100 + 1))
    }
}

fun readInputLine(): String {
    return readLine()!!
}
