import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int cnt = 0;
		double ans = 0;
		while(true){
			if(Math.pow(2,cnt)>n){
				ans = Math.pow(2, cnt-1);
				break;
			}
			cnt++;
		}
		System.out.println((int)ans);
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int cnt = 0;
		double ans = 0;
		while(true){
			if(Math.pow(2,cnt)>n){
				ans = Math.pow(2, cnt-1);
				break;
			}
			cnt++;
		}
		System.out.println((int)ans);
	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int cnt = 0;
		double ans = 0;
		while(true){
			if(Math.pow(2,cnt)>n){
				ans = Math.pow(2, cnt-1);
				break;
			}
			cnt++;
		}
		System.out.println((int)ans);
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int cnt = 0;
		double ans = 0;
		while(true){
			if(Math.pow(2,cnt)>n){
				ans = Math.pow(2, cnt-1);
				break;
			}
			cnt++;
		}
		System.out.println((int)ans);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int cnt = 0; cnt 0 double ans = 0; ans 0 while(true){
			if(Math.pow(2,cnt)>n){
				ans = Math.pow(2, cnt-1);
				break;
			}
			cnt++;
		} true {
			if(Math.pow(2,cnt)>n){
				ans = Math.pow(2, cnt-1);
				break;
			}
			cnt++;
		} if(Math.pow(2,cnt)>n){
				ans = Math.pow(2, cnt-1);
				break;
			} Math.pow(2,cnt)>n Math.pow(2,cnt) Math.pow Math 2 cnt n {
				ans = Math.pow(2, cnt-1);
				break;
			} ans = Math.pow(2, cnt-1) ans Math.pow(2, cnt-1) Math.pow Math 2 cnt-1 cnt 1 break; cnt++ cnt System.out.println((int)ans) System.out.println System.out System System.out (int)ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int cnt = 0;
		double ans = 0;
		while(true){
			if(Math.pow(2,cnt)>n){
				ans = Math.pow(2, cnt-1);
				break;
			}
			cnt++;
		}
		System.out.println((int)ans);
	}

} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int cnt = 0;
		double ans = 0;
		while(true){
			if(Math.pow(2,cnt)>n){
				ans = Math.pow(2, cnt-1);
				break;
			}
			cnt++;
		}
		System.out.println((int)ans);
	}

} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int cnt = 0;
		double ans = 0;
		while(true){
			if(Math.pow(2,cnt)>n){
				ans = Math.pow(2, cnt-1);
				break;
			}
			cnt++;
		}
		System.out.println((int)ans);
	}

}
