fun main(args: Array<String>) {
    val n = readLine()!!.toInt()

    var t = 64
    var result = 1
    while (t > 1) {
        if (t <= n) {
            result = t
            break
        }
        t = t / 2
    }

    print(result)
}
