import java.util.*;

public class Main {
	static final int[] EVEN = new int[]{1, 2, 4, 8, 16, 32, 64};
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		for (int i = 0; i < EVEN.length; i++) {
			if (EVEN[i] <= n) {
				max = EVEN[i];
			}
		}
		System.out.println(max);
	}
} import java.util.*; util.* java public class Main {
	static final int[] EVEN = new int[]{1, 2, 4, 8, 16, 32, 64};
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		for (int i = 0; i < EVEN.length; i++) {
			if (EVEN[i] <= n) {
				max = EVEN[i];
			}
		}
		System.out.println(max);
	}
} Main static final int[] EVEN = new int[]{1, 2, 4, 8, 16, 32, 64}; EVEN new int[]{1, 2, 4, 8, 16, 32, 64} public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		for (int i = 0; i < EVEN.length; i++) {
			if (EVEN[i] <= n) {
				max = EVEN[i];
			}
		}
		System.out.println(max);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		for (int i = 0; i < EVEN.length; i++) {
			if (EVEN[i] <= n) {
				max = EVEN[i];
			}
		}
		System.out.println(max);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int max = 0; max 0 for (int i = 0; i < EVEN.length; i++) {
			if (EVEN[i] <= n) {
				max = EVEN[i];
			}
		} int i = 0; int i = 0; i 0 i < EVEN.length i EVEN.length EVEN EVEN.length i++ i++ i {
			if (EVEN[i] <= n) {
				max = EVEN[i];
			}
		} {
			if (EVEN[i] <= n) {
				max = EVEN[i];
			}
		} if (EVEN[i] <= n) {
				max = EVEN[i];
			} EVEN[i] <= n EVEN[i] EVEN i n {
				max = EVEN[i];
			} max = EVEN[i] max EVEN[i] EVEN i System.out.println(max) System.out.println System.out System System.out max String[] args args public class Main {
	static final int[] EVEN = new int[]{1, 2, 4, 8, 16, 32, 64};
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		for (int i = 0; i < EVEN.length; i++) {
			if (EVEN[i] <= n) {
				max = EVEN[i];
			}
		}
		System.out.println(max);
	}
} public class Main {
	static final int[] EVEN = new int[]{1, 2, 4, 8, 16, 32, 64};
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		for (int i = 0; i < EVEN.length; i++) {
			if (EVEN[i] <= n) {
				max = EVEN[i];
			}
		}
		System.out.println(max);
	}
} Main
import java.util.*;

public class Main {
	static final int[] EVEN = new int[]{1, 2, 4, 8, 16, 32, 64};
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		for (int i = 0; i < EVEN.length; i++) {
			if (EVEN[i] <= n) {
				max = EVEN[i];
			}
		}
		System.out.println(max);
	}
}
