import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int ans = 0;
		for (int i = 0;; i++) {
			if ((double)n >= Math.pow(2, i)) {
				continue;
			}else{
				ans = (int)Math.pow(2, i-1);
				break;
			}
		}
		
		System.out.println(ans);
		scanner.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int ans = 0;
		for (int i = 0;; i++) {
			if ((double)n >= Math.pow(2, i)) {
				continue;
			}else{
				ans = (int)Math.pow(2, i-1);
				break;
			}
		}
		
		System.out.println(ans);
		scanner.close();
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int ans = 0;
		for (int i = 0;; i++) {
			if ((double)n >= Math.pow(2, i)) {
				continue;
			}else{
				ans = (int)Math.pow(2, i-1);
				break;
			}
		}
		
		System.out.println(ans);
		scanner.close();
	} main {
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int ans = 0;
		for (int i = 0;; i++) {
			if ((double)n >= Math.pow(2, i)) {
				continue;
			}else{
				ans = (int)Math.pow(2, i-1);
				break;
			}
		}
		
		System.out.println(ans);
		scanner.close();
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int ans = 0; ans 0 for (int i = 0;; i++) {
			if ((double)n >= Math.pow(2, i)) {
				continue;
			}else{
				ans = (int)Math.pow(2, i-1);
				break;
			}
		} int i = 0; int i = 0; i 0 i++ i++ i {
			if ((double)n >= Math.pow(2, i)) {
				continue;
			}else{
				ans = (int)Math.pow(2, i-1);
				break;
			}
		} {
			if ((double)n >= Math.pow(2, i)) {
				continue;
			}else{
				ans = (int)Math.pow(2, i-1);
				break;
			}
		} if ((double)n >= Math.pow(2, i)) {
				continue;
			}else{
				ans = (int)Math.pow(2, i-1);
				break;
			} (double)n >= Math.pow(2, i) (double)n Math.pow(2, i) Math.pow Math 2 i {
				continue;
			} continue; {
				ans = (int)Math.pow(2, i-1);
				break;
			} ans = (int)Math.pow(2, i-1) ans (int)Math.pow(2, i-1) Math.pow Math 2 i-1 i 1 break; System.out.println(ans) System.out.println System.out System System.out ans scanner.close() scanner.close scanner String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int ans = 0;
		for (int i = 0;; i++) {
			if ((double)n >= Math.pow(2, i)) {
				continue;
			}else{
				ans = (int)Math.pow(2, i-1);
				break;
			}
		}
		
		System.out.println(ans);
		scanner.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int ans = 0;
		for (int i = 0;; i++) {
			if ((double)n >= Math.pow(2, i)) {
				continue;
			}else{
				ans = (int)Math.pow(2, i-1);
				break;
			}
		}
		
		System.out.println(ans);
		scanner.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int ans = 0;
		for (int i = 0;; i++) {
			if ((double)n >= Math.pow(2, i)) {
				continue;
			}else{
				ans = (int)Math.pow(2, i-1);
				break;
			}
		}
		
		System.out.println(ans);
		scanner.close();
	}
}