import java.util.Scanner;

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

	void solve(Scanner sc) {
		int N = sc.nextInt();
		int d = 0;
		if (N == 0) {
			System.out.println("0");
			return;
		}

		for (int i = 0; i < 7; i++) {
			d = (int) Math.pow(2, i);
			if (N / d == 1) {
				break;
			}
		}
		System.out.println(d);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		Scanner sc = new Scanner(System.in);
		main.solve(sc);
		sc.close();
	}

	void solve(Scanner sc) {
		int N = sc.nextInt();
		int d = 0;
		if (N == 0) {
			System.out.println("0");
			return;
		}

		for (int i = 0; i < 7; i++) {
			d = (int) Math.pow(2, i);
			if (N / d == 1) {
				break;
			}
		}
		System.out.println(d);
	}
} Main public static void main(String[] args) {
		Main main = new Main();
		Scanner sc = new Scanner(System.in);
		main.solve(sc);
		sc.close();
	} main {
		Main main = new Main();
		Scanner sc = new Scanner(System.in);
		main.solve(sc);
		sc.close();
	} Main main = new Main(); main new Main() Scanner sc = new Scanner(System.in); sc new Scanner(System.in) main.solve(sc) main.solve main sc sc.close() sc.close sc String[] args args void solve(Scanner sc) {
		int N = sc.nextInt();
		int d = 0;
		if (N == 0) {
			System.out.println("0");
			return;
		}

		for (int i = 0; i < 7; i++) {
			d = (int) Math.pow(2, i);
			if (N / d == 1) {
				break;
			}
		}
		System.out.println(d);
	} solve {
		int N = sc.nextInt();
		int d = 0;
		if (N == 0) {
			System.out.println("0");
			return;
		}

		for (int i = 0; i < 7; i++) {
			d = (int) Math.pow(2, i);
			if (N / d == 1) {
				break;
			}
		}
		System.out.println(d);
	} int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int d = 0; d 0 if (N == 0) {
			System.out.println("0");
			return;
		} N == 0 N 0 {
			System.out.println("0");
			return;
		} System.out.println("0") System.out.println System.out System System.out "0" return; for (int i = 0; i < 7; i++) {
			d = (int) Math.pow(2, i);
			if (N / d == 1) {
				break;
			}
		} int i = 0; int i = 0; i 0 i < 7 i 7 i++ i++ i {
			d = (int) Math.pow(2, i);
			if (N / d == 1) {
				break;
			}
		} {
			d = (int) Math.pow(2, i);
			if (N / d == 1) {
				break;
			}
		} d = (int) Math.pow(2, i) d (int) Math.pow(2, i) Math.pow Math 2 i if (N / d == 1) {
				break;
			} N / d == 1 N / d N d 1 {
				break;
			} break; System.out.println(d) System.out.println System.out System System.out d Scanner sc sc public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		Scanner sc = new Scanner(System.in);
		main.solve(sc);
		sc.close();
	}

	void solve(Scanner sc) {
		int N = sc.nextInt();
		int d = 0;
		if (N == 0) {
			System.out.println("0");
			return;
		}

		for (int i = 0; i < 7; i++) {
			d = (int) Math.pow(2, i);
			if (N / d == 1) {
				break;
			}
		}
		System.out.println(d);
	}
} public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		Scanner sc = new Scanner(System.in);
		main.solve(sc);
		sc.close();
	}

	void solve(Scanner sc) {
		int N = sc.nextInt();
		int d = 0;
		if (N == 0) {
			System.out.println("0");
			return;
		}

		for (int i = 0; i < 7; i++) {
			d = (int) Math.pow(2, i);
			if (N / d == 1) {
				break;
			}
		}
		System.out.println(d);
	}
} Main
import java.util.Scanner;

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

	void solve(Scanner sc) {
		int N = sc.nextInt();
		int d = 0;
		if (N == 0) {
			System.out.println("0");
			return;
		}

		for (int i = 0; i < 7; i++) {
			d = (int) Math.pow(2, i);
			if (N / d == 1) {
				break;
			}
		}
		System.out.println(d);
	}
}
