import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			int result = 1;
			while ((result << 1) <= n) {
				result <<= 1;
			}
			System.out.println(result);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			int result = 1;
			while ((result << 1) <= n) {
				result <<= 1;
			}
			System.out.println(result);
		}
	}
} Main public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			int result = 1;
			while ((result << 1) <= n) {
				result <<= 1;
			}
			System.out.println(result);
		}
	} main {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			int result = 1;
			while ((result << 1) <= n) {
				result <<= 1;
			}
			System.out.println(result);
		}
	} try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			int result = 1;
			while ((result << 1) <= n) {
				result <<= 1;
			}
			System.out.println(result);
		} {
			int n = scanner.nextInt();
			int result = 1;
			while ((result << 1) <= n) {
				result <<= 1;
			}
			System.out.println(result);
		} Scanner scanner = new Scanner(System.in) Scanner scanner = new Scanner(System.in) new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int result = 1; result 1 while ((result << 1) <= n) {
				result <<= 1;
			} (result << 1) <= n (result << 1) result 1 n {
				result <<= 1;
			} result <<= 1 result 1 System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			int result = 1;
			while ((result << 1) <= n) {
				result <<= 1;
			}
			System.out.println(result);
		}
	}
} public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			int result = 1;
			while ((result << 1) <= n) {
				result <<= 1;
			}
			System.out.println(result);
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			int result = 1;
			while ((result << 1) <= n) {
				result <<= 1;
			}
			System.out.println(result);
		}
	}
}
