import java.util.Scanner;

public class Main {

    public static void main (String [] args){
        Scanner sc = new Scanner(System.in);
        int N =sc.nextInt();
        if(N==1){
            System.out.println(1);
        }else{
            int ans =0;
            for (int i=2;i<=N;i=i*2){
                ans=i;
            }
            System.out.println(ans);
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main (String [] args){
        Scanner sc = new Scanner(System.in);
        int N =sc.nextInt();
        if(N==1){
            System.out.println(1);
        }else{
            int ans =0;
            for (int i=2;i<=N;i=i*2){
                ans=i;
            }
            System.out.println(ans);
        }
    }
} Main public static void main (String [] args){
        Scanner sc = new Scanner(System.in);
        int N =sc.nextInt();
        if(N==1){
            System.out.println(1);
        }else{
            int ans =0;
            for (int i=2;i<=N;i=i*2){
                ans=i;
            }
            System.out.println(ans);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int N =sc.nextInt();
        if(N==1){
            System.out.println(1);
        }else{
            int ans =0;
            for (int i=2;i<=N;i=i*2){
                ans=i;
            }
            System.out.println(ans);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N =sc.nextInt(); N sc.nextInt() sc.nextInt sc if(N==1){
            System.out.println(1);
        }else{
            int ans =0;
            for (int i=2;i<=N;i=i*2){
                ans=i;
            }
            System.out.println(ans);
        } N==1 N 1 {
            System.out.println(1);
        } System.out.println(1) System.out.println System.out System System.out 1 {
            int ans =0;
            for (int i=2;i<=N;i=i*2){
                ans=i;
            }
            System.out.println(ans);
        } int ans =0; ans 0 for (int i=2;i<=N;i=i*2){
                ans=i;
            } int i=2; int i=2; i 2 i<=N i N i=i*2 i=i*2 i i*2 i 2 {
                ans=i;
            } {
                ans=i;
            } ans=i ans i System.out.println(ans) System.out.println System.out System System.out ans String [] args args public class Main {

    public static void main (String [] args){
        Scanner sc = new Scanner(System.in);
        int N =sc.nextInt();
        if(N==1){
            System.out.println(1);
        }else{
            int ans =0;
            for (int i=2;i<=N;i=i*2){
                ans=i;
            }
            System.out.println(ans);
        }
    }
} public class Main {

    public static void main (String [] args){
        Scanner sc = new Scanner(System.in);
        int N =sc.nextInt();
        if(N==1){
            System.out.println(1);
        }else{
            int ans =0;
            for (int i=2;i<=N;i=i*2){
                ans=i;
            }
            System.out.println(ans);
        }
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main (String [] args){
        Scanner sc = new Scanner(System.in);
        int N =sc.nextInt();
        if(N==1){
            System.out.println(1);
        }else{
            int ans =0;
            for (int i=2;i<=N;i=i*2){
                ans=i;
            }
            System.out.println(ans);
        }
    }
}
