import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count =0;
		int a[] = new int[9];
		int N = sc.nextInt();
		int temp =1;
		for (int i=0;i<a.length;i++) {
			a[i] = temp;
			temp *=2;
		}
		for (int i=a.length-1;i>=0;i--) {
			if (a[i]<=N) {
				System.out.println(a[i]);
				return;
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count =0;
		int a[] = new int[9];
		int N = sc.nextInt();
		int temp =1;
		for (int i=0;i<a.length;i++) {
			a[i] = temp;
			temp *=2;
		}
		for (int i=a.length-1;i>=0;i--) {
			if (a[i]<=N) {
				System.out.println(a[i]);
				return;
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count =0;
		int a[] = new int[9];
		int N = sc.nextInt();
		int temp =1;
		for (int i=0;i<a.length;i++) {
			a[i] = temp;
			temp *=2;
		}
		for (int i=a.length-1;i>=0;i--) {
			if (a[i]<=N) {
				System.out.println(a[i]);
				return;
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int count =0;
		int a[] = new int[9];
		int N = sc.nextInt();
		int temp =1;
		for (int i=0;i<a.length;i++) {
			a[i] = temp;
			temp *=2;
		}
		for (int i=a.length-1;i>=0;i--) {
			if (a[i]<=N) {
				System.out.println(a[i]);
				return;
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int count =0; count 0 int a[] = new int[9]; a new int[9] 9 int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int temp =1; temp 1 for (int i=0;i<a.length;i++) {
			a[i] = temp;
			temp *=2;
		} int i=0; int i=0; i 0 i<a.length i a.length a a.length i++ i++ i {
			a[i] = temp;
			temp *=2;
		} {
			a[i] = temp;
			temp *=2;
		} a[i] = temp a[i] a i temp temp *=2 temp 2 for (int i=a.length-1;i>=0;i--) {
			if (a[i]<=N) {
				System.out.println(a[i]);
				return;
			}
		} int i=a.length-1; int i=a.length-1; i a.length-1 a.length a a.length 1 i>=0 i 0 i-- i-- i {
			if (a[i]<=N) {
				System.out.println(a[i]);
				return;
			}
		} {
			if (a[i]<=N) {
				System.out.println(a[i]);
				return;
			}
		} if (a[i]<=N) {
				System.out.println(a[i]);
				return;
			} a[i]<=N a[i] a i N {
				System.out.println(a[i]);
				return;
			} System.out.println(a[i]) System.out.println System.out System System.out a[i] a i return; String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count =0;
		int a[] = new int[9];
		int N = sc.nextInt();
		int temp =1;
		for (int i=0;i<a.length;i++) {
			a[i] = temp;
			temp *=2;
		}
		for (int i=a.length-1;i>=0;i--) {
			if (a[i]<=N) {
				System.out.println(a[i]);
				return;
			}
		}
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count =0;
		int a[] = new int[9];
		int N = sc.nextInt();
		int temp =1;
		for (int i=0;i<a.length;i++) {
			a[i] = temp;
			temp *=2;
		}
		for (int i=a.length-1;i>=0;i--) {
			if (a[i]<=N) {
				System.out.println(a[i]);
				return;
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count =0;
		int a[] = new int[9];
		int N = sc.nextInt();
		int temp =1;
		for (int i=0;i<a.length;i++) {
			a[i] = temp;
			temp *=2;
		}
		for (int i=a.length-1;i>=0;i--) {
			if (a[i]<=N) {
				System.out.println(a[i]);
				return;
			}
		}
	}
}