import scala.io.StdIn

object Main extends App {

  val n = StdIn.readLine().toInt
  
  val r = (1 to n).foldLeft((0, 1)){ (acc, k) =>
    
    def loop(i: Int, cnt: Int): Int = {
      if(i < 2 || i % 2 != 0) cnt
      else {
        loop(i / 2, cnt + 1)
      }
    }
    val cntMax = loop(k, 0)
      
    if(acc._1 < cntMax) (cntMax, k)
    else acc
  }

  println(r._2)
}
