import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for(int i = 0; i < n; i++){
            if(n == Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i));
                break;
            }else if(n < Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i-1));
                break;
            }
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for(int i = 0; i < n; i++){
            if(n == Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i));
                break;
            }else if(n < Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i-1));
                break;
            }
        }
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for(int i = 0; i < n; i++){
            if(n == Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i));
                break;
            }else if(n < Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i-1));
                break;
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for(int i = 0; i < n; i++){
            if(n == Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i));
                break;
            }else if(n < Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i-1));
                break;
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for(int i = 0; i < n; i++){
            if(n == Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i));
                break;
            }else if(n < Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i-1));
                break;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if(n == Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i));
                break;
            }else if(n < Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i-1));
                break;
            }
        } {
            if(n == Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i));
                break;
            }else if(n < Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i-1));
                break;
            }
        } if(n == Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i));
                break;
            }else if(n < Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i-1));
                break;
            } n == Math.pow(2,i) n Math.pow(2,i) Math.pow Math 2 i {
                System.out.println((int)Math.pow(2,i));
                break;
            } System.out.println((int)Math.pow(2,i)) System.out.println System.out System System.out (int)Math.pow(2,i) Math.pow Math 2 i break; if(n < Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i-1));
                break;
            } n < Math.pow(2,i) n Math.pow(2,i) Math.pow Math 2 i {
                System.out.println((int)Math.pow(2,i-1));
                break;
            } System.out.println((int)Math.pow(2,i-1)) System.out.println System.out System System.out (int)Math.pow(2,i-1) Math.pow Math 2 i-1 i 1 break; String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for(int i = 0; i < n; i++){
            if(n == Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i));
                break;
            }else if(n < Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i-1));
                break;
            }
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for(int i = 0; i < n; i++){
            if(n == Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i));
                break;
            }else if(n < Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i-1));
                break;
            }
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for(int i = 0; i < n; i++){
            if(n == Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i));
                break;
            }else if(n < Math.pow(2,i)){
                System.out.println((int)Math.pow(2,i-1));
                break;
            }
        }
    }
}
