import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc =new Scanner(System.in);
		int N=sc.nextInt();
		for(int i =0;i<=8;i++){
			if(Math.pow(2, i)<=N&&N<Math.pow(2, i+1)){
				System.out.println((int)Math.pow(2, i));
				break;
			}

		}

	}

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

	public static void main(String[] args) {
		Scanner sc =new Scanner(System.in);
		int N=sc.nextInt();
		for(int i =0;i<=8;i++){
			if(Math.pow(2, i)<=N&&N<Math.pow(2, i+1)){
				System.out.println((int)Math.pow(2, i));
				break;
			}

		}

	}

} Main public static void main(String[] args) {
		Scanner sc =new Scanner(System.in);
		int N=sc.nextInt();
		for(int i =0;i<=8;i++){
			if(Math.pow(2, i)<=N&&N<Math.pow(2, i+1)){
				System.out.println((int)Math.pow(2, i));
				break;
			}

		}

	} main {
		Scanner sc =new Scanner(System.in);
		int N=sc.nextInt();
		for(int i =0;i<=8;i++){
			if(Math.pow(2, i)<=N&&N<Math.pow(2, i+1)){
				System.out.println((int)Math.pow(2, i));
				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 =0;i<=8;i++){
			if(Math.pow(2, i)<=N&&N<Math.pow(2, i+1)){
				System.out.println((int)Math.pow(2, i));
				break;
			}

		} int i =0; int i =0; i 0 i<=8 i 8 i++ i++ i {
			if(Math.pow(2, i)<=N&&N<Math.pow(2, i+1)){
				System.out.println((int)Math.pow(2, i));
				break;
			}

		} {
			if(Math.pow(2, i)<=N&&N<Math.pow(2, i+1)){
				System.out.println((int)Math.pow(2, i));
				break;
			}

		} if(Math.pow(2, i)<=N&&N<Math.pow(2, i+1)){
				System.out.println((int)Math.pow(2, i));
				break;
			} Math.pow(2, i)<=N&&N<Math.pow(2, i+1) Math.pow(2, i)<=N Math.pow(2, i) Math.pow Math 2 i N N<Math.pow(2, i+1) N Math.pow(2, i+1) Math.pow Math 2 i+1 i 1 {
				System.out.println((int)Math.pow(2, i));
				break;
			} System.out.println((int)Math.pow(2, i)) System.out.println System.out System System.out (int)Math.pow(2, i) Math.pow Math 2 i break; String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc =new Scanner(System.in);
		int N=sc.nextInt();
		for(int i =0;i<=8;i++){
			if(Math.pow(2, i)<=N&&N<Math.pow(2, i+1)){
				System.out.println((int)Math.pow(2, i));
				break;
			}

		}

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc =new Scanner(System.in);
		int N=sc.nextInt();
		for(int i =0;i<=8;i++){
			if(Math.pow(2, i)<=N&&N<Math.pow(2, i+1)){
				System.out.println((int)Math.pow(2, i));
				break;
			}

		}

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc =new Scanner(System.in);
		int N=sc.nextInt();
		for(int i =0;i<=8;i++){
			if(Math.pow(2, i)<=N&&N<Math.pow(2, i+1)){
				System.out.println((int)Math.pow(2, i));
				break;
			}

		}

	}

}
