import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val n = sc.nextInt()
    for (i <- 1 to n) {
      if (math.pow(2, i) > n) {
        println(math.pow(2, i - 1).toInt)
        sys.exit(0)
      }
    }
  }
}
