fun main(args: Array<String>) {
    val n = readLine()?.toInt() ?: return
    val max = when {
        n >= 64 -> 64
        n >= 32 -> 32
        n >= 16 -> 16
        n >= 8 -> 8
        n >= 4 -> 4
        n >= 2 -> 2
        else -> n
    }
    println(max)
}