import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        int two = 1;
        while (two * 2<= n) {
            two *= 2;
        }
        System.out.println(two);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        int two = 1;
        while (two * 2<= n) {
            two *= 2;
        }
        System.out.println(two);
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        int two = 1;
        while (two * 2<= n) {
            two *= 2;
        }
        System.out.println(two);
    } main {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        int two = 1;
        while (two * 2<= n) {
            two *= 2;
        }
        System.out.println(two);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int two = 1; two 1 while (two * 2<= n) {
            two *= 2;
        } two * 2<= n two * 2 two 2 n {
            two *= 2;
        } two *= 2 two 2 System.out.println(two) System.out.println System.out System System.out two String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        int two = 1;
        while (two * 2<= n) {
            two *= 2;
        }
        System.out.println(two);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        int two = 1;
        while (two * 2<= n) {
            two *= 2;
        }
        System.out.println(two);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        int two = 1;
        while (two * 2<= n) {
            two *= 2;
        }
        System.out.println(two);
    }
}