import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str = br.readLine();
		int n = Integer.parseInt(str);

		int ans = 0;
		int id = n;

		for (int i = 1; i <= n; i++) {
			if (i % 2 == 0) {
				int num = i;
				int count = 0;
				while (num % 2 == 0) {
					num /= 2;
					count++;
				}
				if (count > ans) {
					ans = count;
					id = i;
				}
			}
		}
		System.out.println(id);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str = br.readLine();
		int n = Integer.parseInt(str);

		int ans = 0;
		int id = n;

		for (int i = 1; i <= n; i++) {
			if (i % 2 == 0) {
				int num = i;
				int count = 0;
				while (num % 2 == 0) {
					num /= 2;
					count++;
				}
				if (count > ans) {
					ans = count;
					id = i;
				}
			}
		}
		System.out.println(id);
	}
} Main public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str = br.readLine();
		int n = Integer.parseInt(str);

		int ans = 0;
		int id = n;

		for (int i = 1; i <= n; i++) {
			if (i % 2 == 0) {
				int num = i;
				int count = 0;
				while (num % 2 == 0) {
					num /= 2;
					count++;
				}
				if (count > ans) {
					ans = count;
					id = i;
				}
			}
		}
		System.out.println(id);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str = br.readLine();
		int n = Integer.parseInt(str);

		int ans = 0;
		int id = n;

		for (int i = 1; i <= n; i++) {
			if (i % 2 == 0) {
				int num = i;
				int count = 0;
				while (num % 2 == 0) {
					num /= 2;
					count++;
				}
				if (count > ans) {
					ans = count;
					id = i;
				}
			}
		}
		System.out.println(id);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str = br.readLine(); str br.readLine() br.readLine br int n = Integer.parseInt(str); n Integer.parseInt(str) Integer.parseInt Integer str int ans = 0; ans 0 int id = n; id n for (int i = 1; i <= n; i++) {
			if (i % 2 == 0) {
				int num = i;
				int count = 0;
				while (num % 2 == 0) {
					num /= 2;
					count++;
				}
				if (count > ans) {
					ans = count;
					id = i;
				}
			}
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			if (i % 2 == 0) {
				int num = i;
				int count = 0;
				while (num % 2 == 0) {
					num /= 2;
					count++;
				}
				if (count > ans) {
					ans = count;
					id = i;
				}
			}
		} {
			if (i % 2 == 0) {
				int num = i;
				int count = 0;
				while (num % 2 == 0) {
					num /= 2;
					count++;
				}
				if (count > ans) {
					ans = count;
					id = i;
				}
			}
		} if (i % 2 == 0) {
				int num = i;
				int count = 0;
				while (num % 2 == 0) {
					num /= 2;
					count++;
				}
				if (count > ans) {
					ans = count;
					id = i;
				}
			} i % 2 == 0 i % 2 i 2 0 {
				int num = i;
				int count = 0;
				while (num % 2 == 0) {
					num /= 2;
					count++;
				}
				if (count > ans) {
					ans = count;
					id = i;
				}
			} int num = i; num i int count = 0; count 0 while (num % 2 == 0) {
					num /= 2;
					count++;
				} num % 2 == 0 num % 2 num 2 0 {
					num /= 2;
					count++;
				} num /= 2 num 2 count++ count if (count > ans) {
					ans = count;
					id = i;
				} count > ans count ans {
					ans = count;
					id = i;
				} ans = count ans count id = i id i System.out.println(id) System.out.println System.out System System.out id String args[] args public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str = br.readLine();
		int n = Integer.parseInt(str);

		int ans = 0;
		int id = n;

		for (int i = 1; i <= n; i++) {
			if (i % 2 == 0) {
				int num = i;
				int count = 0;
				while (num % 2 == 0) {
					num /= 2;
					count++;
				}
				if (count > ans) {
					ans = count;
					id = i;
				}
			}
		}
		System.out.println(id);
	}
} public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str = br.readLine();
		int n = Integer.parseInt(str);

		int ans = 0;
		int id = n;

		for (int i = 1; i <= n; i++) {
			if (i % 2 == 0) {
				int num = i;
				int count = 0;
				while (num % 2 == 0) {
					num /= 2;
					count++;
				}
				if (count > ans) {
					ans = count;
					id = i;
				}
			}
		}
		System.out.println(id);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str = br.readLine();
		int n = Integer.parseInt(str);

		int ans = 0;
		int id = n;

		for (int i = 1; i <= n; i++) {
			if (i % 2 == 0) {
				int num = i;
				int count = 0;
				while (num % 2 == 0) {
					num /= 2;
					count++;
				}
				if (count > ans) {
					ans = count;
					id = i;
				}
			}
		}
		System.out.println(id);
	}
}