import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);

		int A = scan.nextInt();
		int [] B = new int [A];
		int ans = 0;
		
		for(int i = 1; i<A;i++){
			B[i-1] = i;
		}
		B[A-1] = A;
	
		if(Arrays.binarySearch(B, 64) >= 0){
			ans = 64;
		} else if (Arrays.binarySearch(B, 32) >= 0){ 
			ans = 32;
		} else if (Arrays.binarySearch(B, 16) >= 0){ 
			ans = 16;
		} else if (Arrays.binarySearch(B, 8) >= 0){ 
			ans = 8;
		} else if (Arrays.binarySearch(B, 4) >= 0){ 
			ans = 4;
		} else if (Arrays.binarySearch(B, 2) >= 0){ 
			ans = 2;
		} else if (Arrays.binarySearch(B, 1) >= 0){ 
			ans = 1;;
		}
		
		System.out.println(ans);
		//System.out.println(Arrays.toString(B));
		
	}
	
	
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);

		int A = scan.nextInt();
		int [] B = new int [A];
		int ans = 0;
		
		for(int i = 1; i<A;i++){
			B[i-1] = i;
		}
		B[A-1] = A;
	
		if(Arrays.binarySearch(B, 64) >= 0){
			ans = 64;
		} else if (Arrays.binarySearch(B, 32) >= 0){ 
			ans = 32;
		} else if (Arrays.binarySearch(B, 16) >= 0){ 
			ans = 16;
		} else if (Arrays.binarySearch(B, 8) >= 0){ 
			ans = 8;
		} else if (Arrays.binarySearch(B, 4) >= 0){ 
			ans = 4;
		} else if (Arrays.binarySearch(B, 2) >= 0){ 
			ans = 2;
		} else if (Arrays.binarySearch(B, 1) >= 0){ 
			ans = 1;;
		}
		
		System.out.println(ans);
		//System.out.println(Arrays.toString(B));
		
	}
	
	
} Main public static void main(String[] args) {

		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);

		int A = scan.nextInt();
		int [] B = new int [A];
		int ans = 0;
		
		for(int i = 1; i<A;i++){
			B[i-1] = i;
		}
		B[A-1] = A;
	
		if(Arrays.binarySearch(B, 64) >= 0){
			ans = 64;
		} else if (Arrays.binarySearch(B, 32) >= 0){ 
			ans = 32;
		} else if (Arrays.binarySearch(B, 16) >= 0){ 
			ans = 16;
		} else if (Arrays.binarySearch(B, 8) >= 0){ 
			ans = 8;
		} else if (Arrays.binarySearch(B, 4) >= 0){ 
			ans = 4;
		} else if (Arrays.binarySearch(B, 2) >= 0){ 
			ans = 2;
		} else if (Arrays.binarySearch(B, 1) >= 0){ 
			ans = 1;;
		}
		
		System.out.println(ans);
		//System.out.println(Arrays.toString(B));
		
	} main {

		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);

		int A = scan.nextInt();
		int [] B = new int [A];
		int ans = 0;
		
		for(int i = 1; i<A;i++){
			B[i-1] = i;
		}
		B[A-1] = A;
	
		if(Arrays.binarySearch(B, 64) >= 0){
			ans = 64;
		} else if (Arrays.binarySearch(B, 32) >= 0){ 
			ans = 32;
		} else if (Arrays.binarySearch(B, 16) >= 0){ 
			ans = 16;
		} else if (Arrays.binarySearch(B, 8) >= 0){ 
			ans = 8;
		} else if (Arrays.binarySearch(B, 4) >= 0){ 
			ans = 4;
		} else if (Arrays.binarySearch(B, 2) >= 0){ 
			ans = 2;
		} else if (Arrays.binarySearch(B, 1) >= 0){ 
			ans = 1;;
		}
		
		System.out.println(ans);
		//System.out.println(Arrays.toString(B));
		
	} @SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int A = scan.nextInt(); A scan.nextInt() scan.nextInt scan int [] B = new int [A]; B new int [A] A int ans = 0; ans 0 for(int i = 1; i<A;i++){
			B[i-1] = i;
		} int i = 1; int i = 1; i 1 i<A i A i++ i++ i {
			B[i-1] = i;
		} {
			B[i-1] = i;
		} B[i-1] = i B[i-1] B i-1 i 1 i B[A-1] = A B[A-1] B A-1 A 1 A if(Arrays.binarySearch(B, 64) >= 0){
			ans = 64;
		} else if (Arrays.binarySearch(B, 32) >= 0){ 
			ans = 32;
		} else if (Arrays.binarySearch(B, 16) >= 0){ 
			ans = 16;
		} else if (Arrays.binarySearch(B, 8) >= 0){ 
			ans = 8;
		} else if (Arrays.binarySearch(B, 4) >= 0){ 
			ans = 4;
		} else if (Arrays.binarySearch(B, 2) >= 0){ 
			ans = 2;
		} else if (Arrays.binarySearch(B, 1) >= 0){ 
			ans = 1;;
		} Arrays.binarySearch(B, 64) >= 0 Arrays.binarySearch(B, 64) Arrays.binarySearch Arrays B 64 0 {
			ans = 64;
		} ans = 64 ans 64 if (Arrays.binarySearch(B, 32) >= 0){ 
			ans = 32;
		} else if (Arrays.binarySearch(B, 16) >= 0){ 
			ans = 16;
		} else if (Arrays.binarySearch(B, 8) >= 0){ 
			ans = 8;
		} else if (Arrays.binarySearch(B, 4) >= 0){ 
			ans = 4;
		} else if (Arrays.binarySearch(B, 2) >= 0){ 
			ans = 2;
		} else if (Arrays.binarySearch(B, 1) >= 0){ 
			ans = 1;;
		} Arrays.binarySearch(B, 32) >= 0 Arrays.binarySearch(B, 32) Arrays.binarySearch Arrays B 32 0 { 
			ans = 32;
		} ans = 32 ans 32 if (Arrays.binarySearch(B, 16) >= 0){ 
			ans = 16;
		} else if (Arrays.binarySearch(B, 8) >= 0){ 
			ans = 8;
		} else if (Arrays.binarySearch(B, 4) >= 0){ 
			ans = 4;
		} else if (Arrays.binarySearch(B, 2) >= 0){ 
			ans = 2;
		} else if (Arrays.binarySearch(B, 1) >= 0){ 
			ans = 1;;
		} Arrays.binarySearch(B, 16) >= 0 Arrays.binarySearch(B, 16) Arrays.binarySearch Arrays B 16 0 { 
			ans = 16;
		} ans = 16 ans 16 if (Arrays.binarySearch(B, 8) >= 0){ 
			ans = 8;
		} else if (Arrays.binarySearch(B, 4) >= 0){ 
			ans = 4;
		} else if (Arrays.binarySearch(B, 2) >= 0){ 
			ans = 2;
		} else if (Arrays.binarySearch(B, 1) >= 0){ 
			ans = 1;;
		} Arrays.binarySearch(B, 8) >= 0 Arrays.binarySearch(B, 8) Arrays.binarySearch Arrays B 8 0 { 
			ans = 8;
		} ans = 8 ans 8 if (Arrays.binarySearch(B, 4) >= 0){ 
			ans = 4;
		} else if (Arrays.binarySearch(B, 2) >= 0){ 
			ans = 2;
		} else if (Arrays.binarySearch(B, 1) >= 0){ 
			ans = 1;;
		} Arrays.binarySearch(B, 4) >= 0 Arrays.binarySearch(B, 4) Arrays.binarySearch Arrays B 4 0 { 
			ans = 4;
		} ans = 4 ans 4 if (Arrays.binarySearch(B, 2) >= 0){ 
			ans = 2;
		} else if (Arrays.binarySearch(B, 1) >= 0){ 
			ans = 1;;
		} Arrays.binarySearch(B, 2) >= 0 Arrays.binarySearch(B, 2) Arrays.binarySearch Arrays B 2 0 { 
			ans = 2;
		} ans = 2 ans 2 if (Arrays.binarySearch(B, 1) >= 0){ 
			ans = 1;;
		} Arrays.binarySearch(B, 1) >= 0 Arrays.binarySearch(B, 1) Arrays.binarySearch Arrays B 1 0 { 
			ans = 1;;
		} ans = 1 ans 1 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) {

		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);

		int A = scan.nextInt();
		int [] B = new int [A];
		int ans = 0;
		
		for(int i = 1; i<A;i++){
			B[i-1] = i;
		}
		B[A-1] = A;
	
		if(Arrays.binarySearch(B, 64) >= 0){
			ans = 64;
		} else if (Arrays.binarySearch(B, 32) >= 0){ 
			ans = 32;
		} else if (Arrays.binarySearch(B, 16) >= 0){ 
			ans = 16;
		} else if (Arrays.binarySearch(B, 8) >= 0){ 
			ans = 8;
		} else if (Arrays.binarySearch(B, 4) >= 0){ 
			ans = 4;
		} else if (Arrays.binarySearch(B, 2) >= 0){ 
			ans = 2;
		} else if (Arrays.binarySearch(B, 1) >= 0){ 
			ans = 1;;
		}
		
		System.out.println(ans);
		//System.out.println(Arrays.toString(B));
		
	}
	
	
} public class Main {

	public static void main(String[] args) {

		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);

		int A = scan.nextInt();
		int [] B = new int [A];
		int ans = 0;
		
		for(int i = 1; i<A;i++){
			B[i-1] = i;
		}
		B[A-1] = A;
	
		if(Arrays.binarySearch(B, 64) >= 0){
			ans = 64;
		} else if (Arrays.binarySearch(B, 32) >= 0){ 
			ans = 32;
		} else if (Arrays.binarySearch(B, 16) >= 0){ 
			ans = 16;
		} else if (Arrays.binarySearch(B, 8) >= 0){ 
			ans = 8;
		} else if (Arrays.binarySearch(B, 4) >= 0){ 
			ans = 4;
		} else if (Arrays.binarySearch(B, 2) >= 0){ 
			ans = 2;
		} else if (Arrays.binarySearch(B, 1) >= 0){ 
			ans = 1;;
		}
		
		System.out.println(ans);
		//System.out.println(Arrays.toString(B));
		
	}
	
	
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);

		int A = scan.nextInt();
		int [] B = new int [A];
		int ans = 0;
		
		for(int i = 1; i<A;i++){
			B[i-1] = i;
		}
		B[A-1] = A;
	
		if(Arrays.binarySearch(B, 64) >= 0){
			ans = 64;
		} else if (Arrays.binarySearch(B, 32) >= 0){ 
			ans = 32;
		} else if (Arrays.binarySearch(B, 16) >= 0){ 
			ans = 16;
		} else if (Arrays.binarySearch(B, 8) >= 0){ 
			ans = 8;
		} else if (Arrays.binarySearch(B, 4) >= 0){ 
			ans = 4;
		} else if (Arrays.binarySearch(B, 2) >= 0){ 
			ans = 2;
		} else if (Arrays.binarySearch(B, 1) >= 0){ 
			ans = 1;;
		}
		
		System.out.println(ans);
		//System.out.println(Arrays.toString(B));
		
	}
	
	
}