import scala.io.StdIn
object Main extends App {
  def breakNumber(number: Int): Int = {
    var count = 0
    var n = number
    while (n > 1) {
      n /= 2
      count += 1
    }
    count
  }
  val N = StdIn.readLine().toInt
  var maxCount = Int.MinValue
  var answer = 0
  for (i <- 1 to N) {
    val count = breakNumber(i)
    if (count > maxCount) {
      maxCount = count
      answer = i
    }
  }
  println(answer)
}
