import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int max = 0;

		for (int i = 0; i <= N; i++) {
			int count = 0;
			for (int j = 0; j < N; j++) {
				if (Math.pow(2, j) == i) {
					count = j;
				}
			}
			max = (max < count) ? count : max;
		}
		System.out.println((int)Math.pow(2, max));
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int max = 0;

		for (int i = 0; i <= N; i++) {
			int count = 0;
			for (int j = 0; j < N; j++) {
				if (Math.pow(2, j) == i) {
					count = j;
				}
			}
			max = (max < count) ? count : max;
		}
		System.out.println((int)Math.pow(2, max));
	}

} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int max = 0;

		for (int i = 0; i <= N; i++) {
			int count = 0;
			for (int j = 0; j < N; j++) {
				if (Math.pow(2, j) == i) {
					count = j;
				}
			}
			max = (max < count) ? count : max;
		}
		System.out.println((int)Math.pow(2, max));
	} main {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int max = 0;

		for (int i = 0; i <= N; i++) {
			int count = 0;
			for (int j = 0; j < N; j++) {
				if (Math.pow(2, j) == i) {
					count = j;
				}
			}
			max = (max < count) ? count : max;
		}
		System.out.println((int)Math.pow(2, max));
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int max = 0; max 0 for (int i = 0; i <= N; i++) {
			int count = 0;
			for (int j = 0; j < N; j++) {
				if (Math.pow(2, j) == i) {
					count = j;
				}
			}
			max = (max < count) ? count : max;
		} int i = 0; int i = 0; i 0 i <= N i N i++ i++ i {
			int count = 0;
			for (int j = 0; j < N; j++) {
				if (Math.pow(2, j) == i) {
					count = j;
				}
			}
			max = (max < count) ? count : max;
		} {
			int count = 0;
			for (int j = 0; j < N; j++) {
				if (Math.pow(2, j) == i) {
					count = j;
				}
			}
			max = (max < count) ? count : max;
		} int count = 0; count 0 for (int j = 0; j < N; j++) {
				if (Math.pow(2, j) == i) {
					count = j;
				}
			} int j = 0; int j = 0; j 0 j < N j N j++ j++ j {
				if (Math.pow(2, j) == i) {
					count = j;
				}
			} {
				if (Math.pow(2, j) == i) {
					count = j;
				}
			} if (Math.pow(2, j) == i) {
					count = j;
				} Math.pow(2, j) == i Math.pow(2, j) Math.pow Math 2 j i {
					count = j;
				} count = j count j max = (max < count) ? count : max max (max < count) ? count : max (max < count) max count count max System.out.println((int)Math.pow(2, max)) System.out.println System.out System System.out (int)Math.pow(2, max) Math.pow Math 2 max String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int max = 0;

		for (int i = 0; i <= N; i++) {
			int count = 0;
			for (int j = 0; j < N; j++) {
				if (Math.pow(2, j) == i) {
					count = j;
				}
			}
			max = (max < count) ? count : max;
		}
		System.out.println((int)Math.pow(2, max));
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int max = 0;

		for (int i = 0; i <= N; i++) {
			int count = 0;
			for (int j = 0; j < N; j++) {
				if (Math.pow(2, j) == i) {
					count = j;
				}
			}
			max = (max < count) ? count : max;
		}
		System.out.println((int)Math.pow(2, max));
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int max = 0;

		for (int i = 0; i <= N; i++) {
			int count = 0;
			for (int j = 0; j < N; j++) {
				if (Math.pow(2, j) == i) {
					count = j;
				}
			}
			max = (max < count) ? count : max;
		}
		System.out.println((int)Math.pow(2, max));
	}

}