import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = 2;
        int c = 2;
        if(a == 1){
            c = 1;
        }
        while(b<a){
            b *= 2;
            if(b<=a){
                c = b;
            }
        }
        System.out.println(c);
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = 2;
        int c = 2;
        if(a == 1){
            c = 1;
        }
        while(b<a){
            b *= 2;
            if(b<=a){
                c = b;
            }
        }
        System.out.println(c);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = 2;
        int c = 2;
        if(a == 1){
            c = 1;
        }
        while(b<a){
            b *= 2;
            if(b<=a){
                c = b;
            }
        }
        System.out.println(c);
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = 2;
        int c = 2;
        if(a == 1){
            c = 1;
        }
        while(b<a){
            b *= 2;
            if(b<=a){
                c = b;
            }
        }
        System.out.println(c);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = 2; b 2 int c = 2; c 2 if(a == 1){
            c = 1;
        } a == 1 a 1 {
            c = 1;
        } c = 1 c 1 while(b<a){
            b *= 2;
            if(b<=a){
                c = b;
            }
        } b<a b a {
            b *= 2;
            if(b<=a){
                c = b;
            }
        } b *= 2 b 2 if(b<=a){
                c = b;
            } b<=a b a {
                c = b;
            } c = b c b System.out.println(c) System.out.println System.out System System.out c String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = 2;
        int c = 2;
        if(a == 1){
            c = 1;
        }
        while(b<a){
            b *= 2;
            if(b<=a){
                c = b;
            }
        }
        System.out.println(c);
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = 2;
        int c = 2;
        if(a == 1){
            c = 1;
        }
        while(b<a){
            b *= 2;
            if(b<=a){
                c = b;
            }
        }
        System.out.println(c);
    }
} Main
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = 2;
        int c = 2;
        if(a == 1){
            c = 1;
        }
        while(b<a){
            b *= 2;
            if(b<=a){
                c = b;
            }
        }
        System.out.println(c);
    }
}