import java.util.*;
public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for(int i = 1;i <= 7;i++) {
			if(Math.pow(2,i) > n){
				System.out.print((int) Math.pow(2,i-1));
				break;
			}
		}
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for(int i = 1;i <= 7;i++) {
			if(Math.pow(2,i) > n){
				System.out.print((int) Math.pow(2,i-1));
				break;
			}
		}
	}
} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for(int i = 1;i <= 7;i++) {
			if(Math.pow(2,i) > n){
				System.out.print((int) Math.pow(2,i-1));
				break;
			}
		}
	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for(int i = 1;i <= 7;i++) {
			if(Math.pow(2,i) > n){
				System.out.print((int) Math.pow(2,i-1));
				break;
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for(int i = 1;i <= 7;i++) {
			if(Math.pow(2,i) > n){
				System.out.print((int) Math.pow(2,i-1));
				break;
			}
		} int i = 1; int i = 1; i 1 i <= 7 i 7 i++ i++ i {
			if(Math.pow(2,i) > n){
				System.out.print((int) Math.pow(2,i-1));
				break;
			}
		} {
			if(Math.pow(2,i) > n){
				System.out.print((int) Math.pow(2,i-1));
				break;
			}
		} if(Math.pow(2,i) > n){
				System.out.print((int) Math.pow(2,i-1));
				break;
			} Math.pow(2,i) > n Math.pow(2,i) Math.pow Math 2 i n {
				System.out.print((int) Math.pow(2,i-1));
				break;
			} System.out.print((int) Math.pow(2,i-1)) System.out.print System.out System System.out (int) Math.pow(2,i-1) Math.pow Math 2 i-1 i 1 break; String[] args args public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for(int i = 1;i <= 7;i++) {
			if(Math.pow(2,i) > n){
				System.out.print((int) Math.pow(2,i-1));
				break;
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for(int i = 1;i <= 7;i++) {
			if(Math.pow(2,i) > n){
				System.out.print((int) Math.pow(2,i-1));
				break;
			}
		}
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for(int i = 1;i <= 7;i++) {
			if(Math.pow(2,i) > n){
				System.out.print((int) Math.pow(2,i-1));
				break;
			}
		}
	}
}
