function main(input){
    const maxNum = [2, 4, 8, 16, 32, 64];
    for(const i = maxNum.length-1; i >= 0; i--){
        if(input >= maxNum[i]){
            console.log(maxNum[i]);
            return 0;
        }
    }
}
 
main(require("fs").readFileSync("/dev/stdin", "utf8"));