import java.io.*;
import java.math.*;
import java.util.*;





public class Main {

    static MyScanner in = new MyScanner();
    static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    int N;
    static int max = 200001;
    static int [] dr = {1,-1,0,0};
    static int [] dc={0,0,-1,1};
    public static void main(String args[]) throws IOException {

        int count =0;
        int [] dp = new int[101];
        for(int i=1;i<=100;i++){
            int N = i;
             count =0;
        while(isEven(N)){
                N>>=1;
                count++;
        }
        dp[i] = count;
    }
    int N = in.nextInt();
    int max =-1;
    int ans =0;
    for(int i=1;i<=N;i++)
        {
            if(max<dp[i])
            {
                ans = i;
                max = dp[i];
            }
        }
        out.println(ans);

        out.flush();
        }
       static boolean isEven(long a){
            return (a&1)==0;
        }
       static  void swap (int a, int b){

        int temmp = b;
        b=a;
        a = temmp;
        }
        static boolean same(int [] arr,int [] temp){
            Arrays.sort(arr);
           Arrays.sort(temp);
            for(int i=0;i<arr.length;i++){
                if(temp[i]!=arr[i])
                return false;
            }
            return true;
        }

 
  


    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     }
} import java.io.*; io.* java import java.math.*; math.* java import java.util.*; util.* java public class Main {

    static MyScanner in = new MyScanner();
    static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    int N;
    static int max = 200001;
    static int [] dr = {1,-1,0,0};
    static int [] dc={0,0,-1,1};
    public static void main(String args[]) throws IOException {

        int count =0;
        int [] dp = new int[101];
        for(int i=1;i<=100;i++){
            int N = i;
             count =0;
        while(isEven(N)){
                N>>=1;
                count++;
        }
        dp[i] = count;
    }
    int N = in.nextInt();
    int max =-1;
    int ans =0;
    for(int i=1;i<=N;i++)
        {
            if(max<dp[i])
            {
                ans = i;
                max = dp[i];
            }
        }
        out.println(ans);

        out.flush();
        }
       static boolean isEven(long a){
            return (a&1)==0;
        }
       static  void swap (int a, int b){

        int temmp = b;
        b=a;
        a = temmp;
        }
        static boolean same(int [] arr,int [] temp){
            Arrays.sort(arr);
           Arrays.sort(temp);
            for(int i=0;i<arr.length;i++){
                if(temp[i]!=arr[i])
                return false;
            }
            return true;
        }

 
  


    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     }
} Main static MyScanner in = new MyScanner(); in new MyScanner() static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); out new PrintWriter(new OutputStreamWriter(System.out)) int N; N static int max = 200001; max 200001 static int [] dr = {1,-1,0,0}; dr {1,-1,0,0} 1 -1 1 0 0 static int [] dc={0,0,-1,1}; dc {0,0,-1,1} 0 0 -1 1 1 public static void main(String args[]) throws IOException {

        int count =0;
        int [] dp = new int[101];
        for(int i=1;i<=100;i++){
            int N = i;
             count =0;
        while(isEven(N)){
                N>>=1;
                count++;
        }
        dp[i] = count;
    }
    int N = in.nextInt();
    int max =-1;
    int ans =0;
    for(int i=1;i<=N;i++)
        {
            if(max<dp[i])
            {
                ans = i;
                max = dp[i];
            }
        }
        out.println(ans);

        out.flush();
        } main {

        int count =0;
        int [] dp = new int[101];
        for(int i=1;i<=100;i++){
            int N = i;
             count =0;
        while(isEven(N)){
                N>>=1;
                count++;
        }
        dp[i] = count;
    }
    int N = in.nextInt();
    int max =-1;
    int ans =0;
    for(int i=1;i<=N;i++)
        {
            if(max<dp[i])
            {
                ans = i;
                max = dp[i];
            }
        }
        out.println(ans);

        out.flush();
        } int count =0; count 0 int [] dp = new int[101]; dp new int[101] 101 for(int i=1;i<=100;i++){
            int N = i;
             count =0;
        while(isEven(N)){
                N>>=1;
                count++;
        }
        dp[i] = count;
    } int i=1; int i=1; i 1 i<=100 i 100 i++ i++ i {
            int N = i;
             count =0;
        while(isEven(N)){
                N>>=1;
                count++;
        }
        dp[i] = count;
    } {
            int N = i;
             count =0;
        while(isEven(N)){
                N>>=1;
                count++;
        }
        dp[i] = count;
    } int N = i; N i count =0 count 0 while(isEven(N)){
                N>>=1;
                count++;
        } isEven(N) isEven N {
                N>>=1;
                count++;
        } N>>=1 N 1 count++ count dp[i] = count dp[i] dp i count int N = in.nextInt(); N in.nextInt() in.nextInt in int max =-1; max -1 1 int ans =0; ans 0 for(int i=1;i<=N;i++)
        {
            if(max<dp[i])
            {
                ans = i;
                max = dp[i];
            }
        } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
            if(max<dp[i])
            {
                ans = i;
                max = dp[i];
            }
        } {
            if(max<dp[i])
            {
                ans = i;
                max = dp[i];
            }
        } if(max<dp[i])
            {
                ans = i;
                max = dp[i];
            } max<dp[i] max dp[i] dp i {
                ans = i;
                max = dp[i];
            } ans = i ans i max = dp[i] max dp[i] dp i out.println(ans) out.println out ans out.flush() out.flush out String args[] args static boolean isEven(long a){
            return (a&1)==0;
        } isEven {
            return (a&1)==0;
        } return (a&1)==0; (a&1)==0 (a&1) a 1 0 long a a static  void swap (int a, int b){

        int temmp = b;
        b=a;
        a = temmp;
        } swap {

        int temmp = b;
        b=a;
        a = temmp;
        } int temmp = b; temmp b b=a b a a = temmp a temmp int a a int b b static boolean same(int [] arr,int [] temp){
            Arrays.sort(arr);
           Arrays.sort(temp);
            for(int i=0;i<arr.length;i++){
                if(temp[i]!=arr[i])
                return false;
            }
            return true;
        } same {
            Arrays.sort(arr);
           Arrays.sort(temp);
            for(int i=0;i<arr.length;i++){
                if(temp[i]!=arr[i])
                return false;
            }
            return true;
        } Arrays.sort(arr) Arrays.sort Arrays arr Arrays.sort(temp) Arrays.sort Arrays temp for(int i=0;i<arr.length;i++){
                if(temp[i]!=arr[i])
                return false;
            } int i=0; int i=0; i 0 i<arr.length i arr.length arr arr.length i++ i++ i {
                if(temp[i]!=arr[i])
                return false;
            } {
                if(temp[i]!=arr[i])
                return false;
            } if(temp[i]!=arr[i])
                return false; temp[i]!=arr[i] temp[i] temp i arr[i] arr i return false; false return true; true int [] arr arr int [] temp temp public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     } MyScanner BufferedReader br; br StringTokenizer st; st public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        } MyScanner {
           br = new BufferedReader(new InputStreamReader(System.in));
        } br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        } next {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        } while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            } st == null || !st.hasMoreElements() st == null st null !st.hasMoreElements() st.hasMoreElements() st.hasMoreElements st {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            } try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                } IOException e {
                    e.printStackTrace();
                } e.printStackTrace() e.printStackTrace e {
                    st = new StringTokenizer(br.readLine());
                } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st int nextInt() {
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next long nextLong() {
            return Long.parseLong(next());
        } nextLong {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next double nextDouble() {
            return Double.parseDouble(next());
        } nextDouble {
            return Double.parseDouble(next());
        } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        } nextLine {
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        } String str = ""; str "" try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        } catch (IOException e) {
           e.printStackTrace();
        } IOException e {
           e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
           str = br.readLine();
        } str = br.readLine() str br.readLine() br.readLine br return str; str public class Main {

    static MyScanner in = new MyScanner();
    static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    int N;
    static int max = 200001;
    static int [] dr = {1,-1,0,0};
    static int [] dc={0,0,-1,1};
    public static void main(String args[]) throws IOException {

        int count =0;
        int [] dp = new int[101];
        for(int i=1;i<=100;i++){
            int N = i;
             count =0;
        while(isEven(N)){
                N>>=1;
                count++;
        }
        dp[i] = count;
    }
    int N = in.nextInt();
    int max =-1;
    int ans =0;
    for(int i=1;i<=N;i++)
        {
            if(max<dp[i])
            {
                ans = i;
                max = dp[i];
            }
        }
        out.println(ans);

        out.flush();
        }
       static boolean isEven(long a){
            return (a&1)==0;
        }
       static  void swap (int a, int b){

        int temmp = b;
        b=a;
        a = temmp;
        }
        static boolean same(int [] arr,int [] temp){
            Arrays.sort(arr);
           Arrays.sort(temp);
            for(int i=0;i<arr.length;i++){
                if(temp[i]!=arr[i])
                return false;
            }
            return true;
        }

 
  


    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     }
} public class Main {

    static MyScanner in = new MyScanner();
    static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    int N;
    static int max = 200001;
    static int [] dr = {1,-1,0,0};
    static int [] dc={0,0,-1,1};
    public static void main(String args[]) throws IOException {

        int count =0;
        int [] dp = new int[101];
        for(int i=1;i<=100;i++){
            int N = i;
             count =0;
        while(isEven(N)){
                N>>=1;
                count++;
        }
        dp[i] = count;
    }
    int N = in.nextInt();
    int max =-1;
    int ans =0;
    for(int i=1;i<=N;i++)
        {
            if(max<dp[i])
            {
                ans = i;
                max = dp[i];
            }
        }
        out.println(ans);

        out.flush();
        }
       static boolean isEven(long a){
            return (a&1)==0;
        }
       static  void swap (int a, int b){

        int temmp = b;
        b=a;
        a = temmp;
        }
        static boolean same(int [] arr,int [] temp){
            Arrays.sort(arr);
           Arrays.sort(temp);
            for(int i=0;i<arr.length;i++){
                if(temp[i]!=arr[i])
                return false;
            }
            return true;
        }

 
  


    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     }
} Main
import java.io.*;
import java.math.*;
import java.util.*;





public class Main {

    static MyScanner in = new MyScanner();
    static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    int N;
    static int max = 200001;
    static int [] dr = {1,-1,0,0};
    static int [] dc={0,0,-1,1};
    public static void main(String args[]) throws IOException {

        int count =0;
        int [] dp = new int[101];
        for(int i=1;i<=100;i++){
            int N = i;
             count =0;
        while(isEven(N)){
                N>>=1;
                count++;
        }
        dp[i] = count;
    }
    int N = in.nextInt();
    int max =-1;
    int ans =0;
    for(int i=1;i<=N;i++)
        {
            if(max<dp[i])
            {
                ans = i;
                max = dp[i];
            }
        }
        out.println(ans);

        out.flush();
        }
       static boolean isEven(long a){
            return (a&1)==0;
        }
       static  void swap (int a, int b){

        int temmp = b;
        b=a;
        a = temmp;
        }
        static boolean same(int [] arr,int [] temp){
            Arrays.sort(arr);
           Arrays.sort(temp);
            for(int i=0;i<arr.length;i++){
                if(temp[i]!=arr[i])
                return false;
            }
            return true;
        }

 
  


    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     }
}