'use strict'

function main(s) {

  const n = Number(s);

  let i = 0;
  while (Math.pow(2, i) <= n) {
    i += 1;
  }

  const ans = Math.pow(2, i - 1);
  console.log(ans);
}

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