fun main (args : Array<String>) {
	val n = readLine()!!
	val N : String = n.toString()
	var list : MutableList<Int> = mutableListOf()
	for (i in N) {
		list.add(i.toString().toInt())
	}
	if ( (list[0] == list[1]) && (list[0] == list[2]) ) {
		return println("${N}")
	} else if ( (list[0] > list[1]) || ( (list[0] == list[1]) && (list[1] > list[2]) ) ) {
		val result = list[0] * 100 + list[0] * 10 + list[0]
		return println("${result}")
	} else {
		val calc : Int = list[0] + 1
		val result = calc * 100 + calc * 10 + calc
		return println("${result}")
	}
}