function main(input) {
  input = input * 1;
  let biggest = 0;
  let biggestId = 0;
  for (let i = 1;i <= input;i++) {
    let nowNum = i;
    let count = 0;
    while (nowNum % 2 === 0) {
      nowNum = nowNum / 2;
      count++;
    }
    if (biggest < count) {
      biggest = count;
      biggestId = i;
    }
  }
  console.log(biggestId);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));