import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val N = sc.nextInt

  val z = (1 to N).maxBy(x => {
    var i = 0
    var a = x
    while (a % 2 == 0) {
      i += 1
      a /= 2
    }

    i
  })
  println(z)
}
