import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//String s = sc.nextLine();
		int s = sc.nextInt();

		int n = 1;

		for (int i = 0; i >= 0; i++) {
			n = n * 2;
			if (n > s) {
				int nn = n / 2;
				System.out.println(nn);
				return;
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//String s = sc.nextLine();
		int s = sc.nextInt();

		int n = 1;

		for (int i = 0; i >= 0; i++) {
			n = n * 2;
			if (n > s) {
				int nn = n / 2;
				System.out.println(nn);
				return;
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//String s = sc.nextLine();
		int s = sc.nextInt();

		int n = 1;

		for (int i = 0; i >= 0; i++) {
			n = n * 2;
			if (n > s) {
				int nn = n / 2;
				System.out.println(nn);
				return;
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		//String s = sc.nextLine();
		int s = sc.nextInt();

		int n = 1;

		for (int i = 0; i >= 0; i++) {
			n = n * 2;
			if (n > s) {
				int nn = n / 2;
				System.out.println(nn);
				return;
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int n = 1; n 1 for (int i = 0; i >= 0; i++) {
			n = n * 2;
			if (n > s) {
				int nn = n / 2;
				System.out.println(nn);
				return;
			}
		} int i = 0; int i = 0; i 0 i >= 0 i 0 i++ i++ i {
			n = n * 2;
			if (n > s) {
				int nn = n / 2;
				System.out.println(nn);
				return;
			}
		} {
			n = n * 2;
			if (n > s) {
				int nn = n / 2;
				System.out.println(nn);
				return;
			}
		} n = n * 2 n n * 2 n 2 if (n > s) {
				int nn = n / 2;
				System.out.println(nn);
				return;
			} n > s n s {
				int nn = n / 2;
				System.out.println(nn);
				return;
			} int nn = n / 2; nn n / 2 n 2 System.out.println(nn) System.out.println System.out System System.out nn return; String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//String s = sc.nextLine();
		int s = sc.nextInt();

		int n = 1;

		for (int i = 0; i >= 0; i++) {
			n = n * 2;
			if (n > s) {
				int nn = n / 2;
				System.out.println(nn);
				return;
			}
		}
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//String s = sc.nextLine();
		int s = sc.nextInt();

		int n = 1;

		for (int i = 0; i >= 0; i++) {
			n = n * 2;
			if (n > s) {
				int nn = n / 2;
				System.out.println(nn);
				return;
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//String s = sc.nextLine();
		int s = sc.nextInt();

		int n = 1;

		for (int i = 0; i >= 0; i++) {
			n = n * 2;
			if (n > s) {
				int nn = n / 2;
				System.out.println(nn);
				return;
			}
		}
	}
}