import java.util.Scanner;
class Main{
	static final Scanner s=new Scanner(System.in);
	public static void main(String[]$){
		int n=s.nextInt(),r=1;
		while(r*2<=n)
			r*=2;
		System.out.println(r);
	}
} import java.util.Scanner; Scanner java.util class Main{
	static final Scanner s=new Scanner(System.in);
	public static void main(String[]$){
		int n=s.nextInt(),r=1;
		while(r*2<=n)
			r*=2;
		System.out.println(r);
	}
} Main static final Scanner s=new Scanner(System.in); s new Scanner(System.in) public static void main(String[]$){
		int n=s.nextInt(),r=1;
		while(r*2<=n)
			r*=2;
		System.out.println(r);
	} main {
		int n=s.nextInt(),r=1;
		while(r*2<=n)
			r*=2;
		System.out.println(r);
	} int n=s.nextInt() n s.nextInt() s.nextInt s r=1; r 1 while(r*2<=n)
			r*=2; r*2<=n r*2 r 2 n r*=2 r 2 System.out.println(r) System.out.println System.out System System.out r String[]$ $
import java.util.Scanner;
class Main{
	static final Scanner s=new Scanner(System.in);
	public static void main(String[]$){
		int n=s.nextInt(),r=1;
		while(r*2<=n)
			r*=2;
		System.out.println(r);
	}
}
