import java.util.*;
// warm-up
public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int a = 1, b = 2, c = 0, n = sc.nextInt();
		while (2*a<=n) {
			a*=b; c++;
		}
		System.out.println((int)Math.pow(2,c));
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

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

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int a = 1, b = 2, c = 0, n = sc.nextInt();
		while (2*a<=n) {
			a*=b; c++;
		}
		System.out.println((int)Math.pow(2,c));
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

} Main static void solve() {
		Scanner sc = new Scanner(System.in);
		int a = 1, b = 2, c = 0, n = sc.nextInt();
		while (2*a<=n) {
			a*=b; c++;
		}
		System.out.println((int)Math.pow(2,c));
		sc.close();		
	} solve {
		Scanner sc = new Scanner(System.in);
		int a = 1, b = 2, c = 0, n = sc.nextInt();
		while (2*a<=n) {
			a*=b; c++;
		}
		System.out.println((int)Math.pow(2,c));
		sc.close();		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = 1 a 1 b = 2 b 2 c = 0 c 0 n = sc.nextInt(); n sc.nextInt() sc.nextInt sc while (2*a<=n) {
			a*=b; c++;
		} 2*a<=n 2*a 2 a n {
			a*=b; c++;
		} a*=b a b c++ c System.out.println((int)Math.pow(2,c)) System.out.println System.out System System.out (int)Math.pow(2,c) Math.pow Math 2 c sc.close() sc.close sc public static void main(String args[]) {
		solve();
	} main {
		solve();
	} solve() solve String args[] args public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int a = 1, b = 2, c = 0, n = sc.nextInt();
		while (2*a<=n) {
			a*=b; c++;
		}
		System.out.println((int)Math.pow(2,c));
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

} public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int a = 1, b = 2, c = 0, n = sc.nextInt();
		while (2*a<=n) {
			a*=b; c++;
		}
		System.out.println((int)Math.pow(2,c));
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

} Main
import java.util.*;
// warm-up
public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int a = 1, b = 2, c = 0, n = sc.nextInt();
		while (2*a<=n) {
			a*=b; c++;
		}
		System.out.println((int)Math.pow(2,c));
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

}