import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {

		int n = sc.nextInt();
		int ans = 1;

		while (n >= ans) {
			ans *= 2;
		}
		System.out.print(ans / 2);

	}
} import java.util.Scanner; Scanner java.util public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {

		int n = sc.nextInt();
		int ans = 1;

		while (n >= ans) {
			ans *= 2;
		}
		System.out.print(ans / 2);

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

		int n = sc.nextInt();
		int ans = 1;

		while (n >= ans) {
			ans *= 2;
		}
		System.out.print(ans / 2);

	} main {

		int n = sc.nextInt();
		int ans = 1;

		while (n >= ans) {
			ans *= 2;
		}
		System.out.print(ans / 2);

	} int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int ans = 1; ans 1 while (n >= ans) {
			ans *= 2;
		} n >= ans n ans {
			ans *= 2;
		} ans *= 2 ans 2 System.out.print(ans / 2) System.out.print System.out System System.out ans / 2 ans 2 String[] args args public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {

		int n = sc.nextInt();
		int ans = 1;

		while (n >= ans) {
			ans *= 2;
		}
		System.out.print(ans / 2);

	}
} public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {

		int n = sc.nextInt();
		int ans = 1;

		while (n >= ans) {
			ans *= 2;
		}
		System.out.print(ans / 2);

	}
} Main
import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {

		int n = sc.nextInt();
		int ans = 1;

		while (n >= ans) {
			ans *= 2;
		}
		System.out.print(ans / 2);

	}
}