#include<stdio.h>
#include<stdlib.h>
int main()
{
	int n,a[105],i,max,count=0,k,t;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		k=i;
		while(k%2==0)
		{
			k/=2;
			a[i]++;
		}

	}
	max=a[1];
	t=1;
	for(i=2;i<=n;i++)
	{
		if(max<a[i])
		{
			max=a[i];
			t=i;
		}
	}
	printf("%d",t);

	return 0;
}
			
