import java.util.*;
 
public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	List<Integer> bi = Arrays.asList(2, 4, 8, 16, 32, 64);
    	for (int i = N; 1 < i; i--) {
    		if (bi.contains(i)) {
    			System.out.println(i);
    			System.exit(0);
    		}
    	}
    	System.out.println(1);
    }
} import java.util.*; util.* java public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	List<Integer> bi = Arrays.asList(2, 4, 8, 16, 32, 64);
    	for (int i = N; 1 < i; i--) {
    		if (bi.contains(i)) {
    			System.out.println(i);
    			System.exit(0);
    		}
    	}
    	System.out.println(1);
    }
} Main public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	List<Integer> bi = Arrays.asList(2, 4, 8, 16, 32, 64);
    	for (int i = N; 1 < i; i--) {
    		if (bi.contains(i)) {
    			System.out.println(i);
    			System.exit(0);
    		}
    	}
    	System.out.println(1);
    } main {
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	List<Integer> bi = Arrays.asList(2, 4, 8, 16, 32, 64);
    	for (int i = N; 1 < i; i--) {
    		if (bi.contains(i)) {
    			System.out.println(i);
    			System.exit(0);
    		}
    	}
    	System.out.println(1);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc List<Integer> bi = Arrays.asList(2, 4, 8, 16, 32, 64); bi Arrays.asList(2, 4, 8, 16, 32, 64) Arrays.asList Arrays 2 4 8 16 32 64 for (int i = N; 1 < i; i--) {
    		if (bi.contains(i)) {
    			System.out.println(i);
    			System.exit(0);
    		}
    	} int i = N; int i = N; i N 1 < i 1 i i-- i-- i {
    		if (bi.contains(i)) {
    			System.out.println(i);
    			System.exit(0);
    		}
    	} {
    		if (bi.contains(i)) {
    			System.out.println(i);
    			System.exit(0);
    		}
    	} if (bi.contains(i)) {
    			System.out.println(i);
    			System.exit(0);
    		} bi.contains(i) bi.contains bi i {
    			System.out.println(i);
    			System.exit(0);
    		} System.out.println(i) System.out.println System.out System System.out i System.exit(0) System.exit System 0 System.out.println(1) System.out.println System.out System System.out 1 String[] args args public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	List<Integer> bi = Arrays.asList(2, 4, 8, 16, 32, 64);
    	for (int i = N; 1 < i; i--) {
    		if (bi.contains(i)) {
    			System.out.println(i);
    			System.exit(0);
    		}
    	}
    	System.out.println(1);
    }
} public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	List<Integer> bi = Arrays.asList(2, 4, 8, 16, 32, 64);
    	for (int i = N; 1 < i; i--) {
    		if (bi.contains(i)) {
    			System.out.println(i);
    			System.exit(0);
    		}
    	}
    	System.out.println(1);
    }
} Main
import java.util.*;
 
public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	List<Integer> bi = Arrays.asList(2, 4, 8, 16, 32, 64);
    	for (int i = N; 1 < i; i--) {
    		if (bi.contains(i)) {
    			System.out.println(i);
    			System.exit(0);
    		}
    	}
    	System.out.println(1);
    }
}