import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
    
		// 整数の入力
		int n = sc.nextInt();
        int standard = 1;
        while (true) {
          int target = standard * 2;
          if (target <= n) {
            standard = target;
          } else {
            break;
          }
        }
        
		// 出力
		System.out.println(standard);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
    
		// 整数の入力
		int n = sc.nextInt();
        int standard = 1;
        while (true) {
          int target = standard * 2;
          if (target <= n) {
            standard = target;
          } else {
            break;
          }
        }
        
		// 出力
		System.out.println(standard);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
    
		// 整数の入力
		int n = sc.nextInt();
        int standard = 1;
        while (true) {
          int target = standard * 2;
          if (target <= n) {
            standard = target;
          } else {
            break;
          }
        }
        
		// 出力
		System.out.println(standard);
	} main {
		Scanner sc = new Scanner(System.in);
    
		// 整数の入力
		int n = sc.nextInt();
        int standard = 1;
        while (true) {
          int target = standard * 2;
          if (target <= n) {
            standard = target;
          } else {
            break;
          }
        }
        
		// 出力
		System.out.println(standard);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int standard = 1; standard 1 while (true) {
          int target = standard * 2;
          if (target <= n) {
            standard = target;
          } else {
            break;
          }
        } true {
          int target = standard * 2;
          if (target <= n) {
            standard = target;
          } else {
            break;
          }
        } int target = standard * 2; target standard * 2 standard 2 if (target <= n) {
            standard = target;
          } else {
            break;
          } target <= n target n {
            standard = target;
          } standard = target standard target {
            break;
          } break; System.out.println(standard) System.out.println System.out System System.out standard String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
    
		// 整数の入力
		int n = sc.nextInt();
        int standard = 1;
        while (true) {
          int target = standard * 2;
          if (target <= n) {
            standard = target;
          } else {
            break;
          }
        }
        
		// 出力
		System.out.println(standard);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
    
		// 整数の入力
		int n = sc.nextInt();
        int standard = 1;
        while (true) {
          int target = standard * 2;
          if (target <= n) {
            standard = target;
          } else {
            break;
          }
        }
        
		// 出力
		System.out.println(standard);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
    
		// 整数の入力
		int n = sc.nextInt();
        int standard = 1;
        while (true) {
          int target = standard * 2;
          if (target <= n) {
            standard = target;
          } else {
            break;
          }
        }
        
		// 出力
		System.out.println(standard);
	}
}