import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		new Main().solve();
	}
	
	void solve(){
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int i=0;
		while(true){
			if((1<<(i+1))<=N)i++;
			else break;
		}
		System.out.println(1<<i);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		new Main().solve();
	}
	
	void solve(){
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int i=0;
		while(true){
			if((1<<(i+1))<=N)i++;
			else break;
		}
		System.out.println(1<<i);
	}

} Main public static void main(String[] args) {
		new Main().solve();
	} main {
		new Main().solve();
	} new Main().solve() new Main().solve new Main() String[] args args void solve(){
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int i=0;
		while(true){
			if((1<<(i+1))<=N)i++;
			else break;
		}
		System.out.println(1<<i);
	} solve {
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int i=0;
		while(true){
			if((1<<(i+1))<=N)i++;
			else break;
		}
		System.out.println(1<<i);
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int N=sc.nextInt(); N sc.nextInt() sc.nextInt sc int i=0; i 0 while(true){
			if((1<<(i+1))<=N)i++;
			else break;
		} true {
			if((1<<(i+1))<=N)i++;
			else break;
		} if((1<<(i+1))<=N)i++;
			else break; (1<<(i+1))<=N (1<<(i+1)) 1 (i+1) i 1 N i++ i break; System.out.println(1<<i) System.out.println System.out System System.out 1<<i 1 i public class Main {

	public static void main(String[] args) {
		new Main().solve();
	}
	
	void solve(){
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int i=0;
		while(true){
			if((1<<(i+1))<=N)i++;
			else break;
		}
		System.out.println(1<<i);
	}

} public class Main {

	public static void main(String[] args) {
		new Main().solve();
	}
	
	void solve(){
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int i=0;
		while(true){
			if((1<<(i+1))<=N)i++;
			else break;
		}
		System.out.println(1<<i);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		new Main().solve();
	}
	
	void solve(){
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int i=0;
		while(true){
			if((1<<(i+1))<=N)i++;
			else break;
		}
		System.out.println(1<<i);
	}

}
