#include<stdio.h>
int main(void){
	int n,m;
	scanf("%d",&n);
	if(n==1)
	m=1;
	if(n>=2&&n<=3)
	m=2;
	if(n>=4&&n<=7)
	m=4;
	if(n>=8&&n<=15)
	m=8;
	if(n>=16&&n<=31)
	m=16;
	if(n>=32&&n<=63)
	m=32;
	if(n>=64&&n<=100)
	m=64;
	
	printf("%d",m);
	
	return 0;
} 