import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val arr = arrayOf(1,2,4,8,16,32,64,128)
    for (i in arr.indices) {
        if (arr[i+1] > n) {
            println(arr[i])
            break
        }
    }
}

