var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var a=input.trim()-0;
var b=1;
while(true){
   b=b*2;
   if(b<a)continue;
   else if(b==a)console.log(b);
   else if(b>a)console.log(b/2);
   break;
}
