object Main extends App{
    val n = scala.io.StdIn.readInt
    
    def get(in: Int): Int = {
        var count = 0
        var numbe = in
        while(numbe % 2 == 0){
            count += 1
            numbe /= 2
        }
        count
    }
    
    val list = (1 to n).map(get(_))
    println((1 to n).filter(get(_) == list.max).mkString)
}