import java.util.*;
 
public class Main {
	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int nam = in.nextInt();
		int nam2[] = {1,2,4,8,16,32,64};
	    
	    int memo = 0;
	    for(int i = 0;i < 7; i++){
	        if(nam>=nam2[i]){
	            memo = nam2[i];
	        }
	    }

        System.out.print(memo);
	}
} import java.util.*; util.* java public class Main {
	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int nam = in.nextInt();
		int nam2[] = {1,2,4,8,16,32,64};
	    
	    int memo = 0;
	    for(int i = 0;i < 7; i++){
	        if(nam>=nam2[i]){
	            memo = nam2[i];
	        }
	    }

        System.out.print(memo);
	}
} Main public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int nam = in.nextInt();
		int nam2[] = {1,2,4,8,16,32,64};
	    
	    int memo = 0;
	    for(int i = 0;i < 7; i++){
	        if(nam>=nam2[i]){
	            memo = nam2[i];
	        }
	    }

        System.out.print(memo);
	} main {
		Scanner in = new Scanner(System.in);
		
		int nam = in.nextInt();
		int nam2[] = {1,2,4,8,16,32,64};
	    
	    int memo = 0;
	    for(int i = 0;i < 7; i++){
	        if(nam>=nam2[i]){
	            memo = nam2[i];
	        }
	    }

        System.out.print(memo);
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int nam = in.nextInt(); nam in.nextInt() in.nextInt in int nam2[] = {1,2,4,8,16,32,64}; nam2 {1,2,4,8,16,32,64} 1 2 4 8 16 32 64 int memo = 0; memo 0 for(int i = 0;i < 7; i++){
	        if(nam>=nam2[i]){
	            memo = nam2[i];
	        }
	    } int i = 0; int i = 0; i 0 i < 7 i 7 i++ i++ i {
	        if(nam>=nam2[i]){
	            memo = nam2[i];
	        }
	    } {
	        if(nam>=nam2[i]){
	            memo = nam2[i];
	        }
	    } if(nam>=nam2[i]){
	            memo = nam2[i];
	        } nam>=nam2[i] nam nam2[i] nam2 i {
	            memo = nam2[i];
	        } memo = nam2[i] memo nam2[i] nam2 i System.out.print(memo) System.out.print System.out System System.out memo String[] args args public class Main {
	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int nam = in.nextInt();
		int nam2[] = {1,2,4,8,16,32,64};
	    
	    int memo = 0;
	    for(int i = 0;i < 7; i++){
	        if(nam>=nam2[i]){
	            memo = nam2[i];
	        }
	    }

        System.out.print(memo);
	}
} public class Main {
	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int nam = in.nextInt();
		int nam2[] = {1,2,4,8,16,32,64};
	    
	    int memo = 0;
	    for(int i = 0;i < 7; i++){
	        if(nam>=nam2[i]){
	            memo = nam2[i];
	        }
	    }

        System.out.print(memo);
	}
} Main
import java.util.*;
 
public class Main {
	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int nam = in.nextInt();
		int nam2[] = {1,2,4,8,16,32,64};
	    
	    int memo = 0;
	    for(int i = 0;i < 7; i++){
	        if(nam>=nam2[i]){
	            memo = nam2[i];
	        }
	    }

        System.out.print(memo);
	}
}