import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int rs = 2;
		int N = scan.nextInt();
		for(int i = 0; i < 7; i++) {
			if(N == 1) break;
			if(N < rs) break; 
			rs = rs * 2;
		}
		if(N == 1) System.out.println(1);
		else System.out.println(rs / 2);
		scan.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int rs = 2;
		int N = scan.nextInt();
		for(int i = 0; i < 7; i++) {
			if(N == 1) break;
			if(N < rs) break; 
			rs = rs * 2;
		}
		if(N == 1) System.out.println(1);
		else System.out.println(rs / 2);
		scan.close();
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int rs = 2;
		int N = scan.nextInt();
		for(int i = 0; i < 7; i++) {
			if(N == 1) break;
			if(N < rs) break; 
			rs = rs * 2;
		}
		if(N == 1) System.out.println(1);
		else System.out.println(rs / 2);
		scan.close();
	} main {
		Scanner scan = new Scanner(System.in);
		int rs = 2;
		int N = scan.nextInt();
		for(int i = 0; i < 7; i++) {
			if(N == 1) break;
			if(N < rs) break; 
			rs = rs * 2;
		}
		if(N == 1) System.out.println(1);
		else System.out.println(rs / 2);
		scan.close();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int rs = 2; rs 2 int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan for(int i = 0; i < 7; i++) {
			if(N == 1) break;
			if(N < rs) break; 
			rs = rs * 2;
		} int i = 0; int i = 0; i 0 i < 7 i 7 i++ i++ i {
			if(N == 1) break;
			if(N < rs) break; 
			rs = rs * 2;
		} {
			if(N == 1) break;
			if(N < rs) break; 
			rs = rs * 2;
		} if(N == 1) break; N == 1 N 1 break; if(N < rs) break; N < rs N rs break; rs = rs * 2 rs rs * 2 rs 2 if(N == 1) System.out.println(1);
		else System.out.println(rs / 2); N == 1 N 1 System.out.println(1) System.out.println System.out System System.out 1 System.out.println(rs / 2) System.out.println System.out System System.out rs / 2 rs 2 scan.close() scan.close scan String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int rs = 2;
		int N = scan.nextInt();
		for(int i = 0; i < 7; i++) {
			if(N == 1) break;
			if(N < rs) break; 
			rs = rs * 2;
		}
		if(N == 1) System.out.println(1);
		else System.out.println(rs / 2);
		scan.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int rs = 2;
		int N = scan.nextInt();
		for(int i = 0; i < 7; i++) {
			if(N == 1) break;
			if(N < rs) break; 
			rs = rs * 2;
		}
		if(N == 1) System.out.println(1);
		else System.out.println(rs / 2);
		scan.close();
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int rs = 2;
		int N = scan.nextInt();
		for(int i = 0; i < 7; i++) {
			if(N == 1) break;
			if(N < rs) break; 
			rs = rs * 2;
		}
		if(N == 1) System.out.println(1);
		else System.out.println(rs / 2);
		scan.close();
	}
}