#include<iostream>
using namespace std;

int main()
{
	int N;


	cin>>N;
	int a =1;
         if(N<2)
		a =1;
	else if(N>=2&&N<4)
		a = 2;
	else if(N>=4&&N<8)
		a = 4;
	else if(N>=8&&N<16)
		a = 8;
	else if(N>=16&&N<32)
		a = 16;
	else if(N>=32&&N<64)
		a = 32;
	else
		a = 64;
	cout<<a<<endl;
	return 0;
}