/**
 * Created by kagawa on 2017/07/29.
 */
function main(input){
    var num = [1, 2, 4, 8, 16, 32, 64];
    for(var i = num.length-1; i>=0; i--){
        if(input >= num[i]){
            console.log(num[i]);
            return;
        }
    }

}

main(require("fs").readFileSync("/dev/stdin", "utf8"));