import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int count = 0;
		while ((int) Math.pow(2, count) <= n) {
			count++;
		}
		System.out.println((int)Math.pow(2, count - 1));

		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int count = 0;
		while ((int) Math.pow(2, count) <= n) {
			count++;
		}
		System.out.println((int)Math.pow(2, count - 1));

		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int count = 0;
		while ((int) Math.pow(2, count) <= n) {
			count++;
		}
		System.out.println((int)Math.pow(2, count - 1));

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int count = 0;
		while ((int) Math.pow(2, count) <= n) {
			count++;
		}
		System.out.println((int)Math.pow(2, count - 1));

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int count = 0; count 0 while ((int) Math.pow(2, count) <= n) {
			count++;
		} (int) Math.pow(2, count) <= n (int) Math.pow(2, count) Math.pow Math 2 count n {
			count++;
		} count++ count System.out.println((int)Math.pow(2, count - 1)) System.out.println System.out System System.out (int)Math.pow(2, count - 1) Math.pow Math 2 count - 1 count 1 sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int count = 0;
		while ((int) Math.pow(2, count) <= n) {
			count++;
		}
		System.out.println((int)Math.pow(2, count - 1));

		sc.close();
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int count = 0;
		while ((int) Math.pow(2, count) <= n) {
			count++;
		}
		System.out.println((int)Math.pow(2, count - 1));

		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int count = 0;
		while ((int) Math.pow(2, count) <= n) {
			count++;
		}
		System.out.println((int)Math.pow(2, count - 1));

		sc.close();
	}
}
