object Main extends App {
  val n = io.StdIn.readLine().toInt
  val tuple = 1.to(n).map(x => {
    var res = 0
    var z = x
    while (z % 2 == 0) {
      z = z / 2
      res += 1
    }
    (res, x)
  }).max
  println(tuple._2)
}