import java.io.*;
import java.util.*;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int n = sc.nextInt();

		if (n == 1) {
			pr.println(1);
		} else {
			int p2 = 2;
			while (p2 * 2 <= n) {
				p2 *= 2;
			}

			pr.println(p2);
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
} import java.io.*; io.* java import java.util.*; util.* java public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int n = sc.nextInt();

		if (n == 1) {
			pr.println(1);
		} else {
			int p2 = 2;
			while (p2 * 2 <= n) {
				p2 *= 2;
			}

			pr.println(p2);
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
} Main private static Scanner sc; sc private static Printer pr; pr private static void solve() {
		int n = sc.nextInt();

		if (n == 1) {
			pr.println(1);
		} else {
			int p2 = 2;
			while (p2 * 2 <= n) {
				p2 *= 2;
			}

			pr.println(p2);
		}
	} solve {
		int n = sc.nextInt();

		if (n == 1) {
			pr.println(1);
		} else {
			int p2 = 2;
			while (p2 * 2 <= n) {
				p2 *= 2;
			}

			pr.println(p2);
		}
	} int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc if (n == 1) {
			pr.println(1);
		} else {
			int p2 = 2;
			while (p2 * 2 <= n) {
				p2 *= 2;
			}

			pr.println(p2);
		} n == 1 n 1 {
			pr.println(1);
		} pr.println(1) pr.println pr 1 {
			int p2 = 2;
			while (p2 * 2 <= n) {
				p2 *= 2;
			}

			pr.println(p2);
		} int p2 = 2; p2 2 while (p2 * 2 <= n) {
				p2 *= 2;
			} p2 * 2 <= n p2 * 2 p2 2 n {
				p2 *= 2;
			} p2 *= 2 p2 2 pr.println(p2) pr.println pr p2 // ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	} main {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	} sc = new Scanner(System.in) sc new Scanner(System.in) pr = new Printer(System.out) pr new Printer(System.out) solve() solve pr.close() pr.close pr sc.close() sc.close sc String[] args args private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	} Printer Printer(PrintStream out) {
			super(out);
		} Printer {
			super(out);
		} super(out) super out PrintStream out out PrintWriter public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int n = sc.nextInt();

		if (n == 1) {
			pr.println(1);
		} else {
			int p2 = 2;
			while (p2 * 2 <= n) {
				p2 *= 2;
			}

			pr.println(p2);
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
} public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int n = sc.nextInt();

		if (n == 1) {
			pr.println(1);
		} else {
			int p2 = 2;
			while (p2 * 2 <= n) {
				p2 *= 2;
			}

			pr.println(p2);
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
} Main
import java.io.*;
import java.util.*;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int n = sc.nextInt();

		if (n == 1) {
			pr.println(1);
		} else {
			int p2 = 2;
			while (p2 * 2 <= n) {
				p2 *= 2;
			}

			pr.println(p2);
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
