import java.io.File;
import java.io.IOException;
import java.util.*;
 
public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int[] t = {1, 2, 4, 8, 16, 32, 64, 101};
		for(int i = 0; i < t.length; i++){
			if(t[i] > N){
				System.out.println(t[i-1]);
				break;
			}
		}
	}
} import java.io.File; File java.io import java.io.IOException; IOException java.io import java.util.*; util.* java public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int[] t = {1, 2, 4, 8, 16, 32, 64, 101};
		for(int i = 0; i < t.length; i++){
			if(t[i] > N){
				System.out.println(t[i-1]);
				break;
			}
		}
	}
} Main public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int[] t = {1, 2, 4, 8, 16, 32, 64, 101};
		for(int i = 0; i < t.length; i++){
			if(t[i] > N){
				System.out.println(t[i-1]);
				break;
			}
		}
	} main {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int[] t = {1, 2, 4, 8, 16, 32, 64, 101};
		for(int i = 0; i < t.length; i++){
			if(t[i] > N){
				System.out.println(t[i-1]);
				break;
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int[] t = {1, 2, 4, 8, 16, 32, 64, 101}; t {1, 2, 4, 8, 16, 32, 64, 101} 1 2 4 8 16 32 64 101 for(int i = 0; i < t.length; i++){
			if(t[i] > N){
				System.out.println(t[i-1]);
				break;
			}
		} int i = 0; int i = 0; i 0 i < t.length i t.length t t.length i++ i++ i {
			if(t[i] > N){
				System.out.println(t[i-1]);
				break;
			}
		} {
			if(t[i] > N){
				System.out.println(t[i-1]);
				break;
			}
		} if(t[i] > N){
				System.out.println(t[i-1]);
				break;
			} t[i] > N t[i] t i N {
				System.out.println(t[i-1]);
				break;
			} System.out.println(t[i-1]) System.out.println System.out System System.out t[i-1] t i-1 i 1 break; String[] args args public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int[] t = {1, 2, 4, 8, 16, 32, 64, 101};
		for(int i = 0; i < t.length; i++){
			if(t[i] > N){
				System.out.println(t[i-1]);
				break;
			}
		}
	}
} public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int[] t = {1, 2, 4, 8, 16, 32, 64, 101};
		for(int i = 0; i < t.length; i++){
			if(t[i] > N){
				System.out.println(t[i-1]);
				break;
			}
		}
	}
} Main
import java.io.File;
import java.io.IOException;
import java.util.*;
 
public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int[] t = {1, 2, 4, 8, 16, 32, 64, 101};
		for(int i = 0; i < t.length; i++){
			if(t[i] > N){
				System.out.println(t[i-1]);
				break;
			}
		}
	}
}