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

public class Main {

    static class Question {
        int N;
        
        public int solve() {
            int i;
            for (i = 0; i < 7; i++) {
                if ( (1 << i) > N ) {
                    break;
                }
            }
            return 1 << (i-1);
        }
        
        public void main(FastScanner in, PrintWriter out) {
            N = in.nextInt();
            out.println( solve() );
        }
        
        public void p(Object o) { System.out.print(o); }
        public void pl(Object o) { System.out.println(o); }
        public void arp(int[] o) { pl( Arrays.toString(o) ); }
        public void arpp(int[][] o) { 
            for (int i = 0; i < o.length; i++) {
                for (int j = 0; j < o[0].length; j++) { p( o[i][j] + " " ); } pl("");
            }
        }
    }

    public static void main(String[] args) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Question q = new Question();
        q.main(in, out);
        out.close();
        in.close();
    }
    
    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        public FastScanner(InputStream in) { br = new BufferedReader(new InputStreamReader(in)); }
        public int nextInt() { return Integer.parseInt(next()); }
        public long nextLong() { return Long.parseLong(next()); }
        public double nextDouble() { return Double.parseDouble(next()); }
        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try { st = new StringTokenizer(br.readLine()); } 
                catch (IOException e) { e.printStackTrace(); }
            }
            return st.nextToken();
        }
        public void close() throws IOException { br.close(); }
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {

    static class Question {
        int N;
        
        public int solve() {
            int i;
            for (i = 0; i < 7; i++) {
                if ( (1 << i) > N ) {
                    break;
                }
            }
            return 1 << (i-1);
        }
        
        public void main(FastScanner in, PrintWriter out) {
            N = in.nextInt();
            out.println( solve() );
        }
        
        public void p(Object o) { System.out.print(o); }
        public void pl(Object o) { System.out.println(o); }
        public void arp(int[] o) { pl( Arrays.toString(o) ); }
        public void arpp(int[][] o) { 
            for (int i = 0; i < o.length; i++) {
                for (int j = 0; j < o[0].length; j++) { p( o[i][j] + " " ); } pl("");
            }
        }
    }

    public static void main(String[] args) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Question q = new Question();
        q.main(in, out);
        out.close();
        in.close();
    }
    
    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        public FastScanner(InputStream in) { br = new BufferedReader(new InputStreamReader(in)); }
        public int nextInt() { return Integer.parseInt(next()); }
        public long nextLong() { return Long.parseLong(next()); }
        public double nextDouble() { return Double.parseDouble(next()); }
        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try { st = new StringTokenizer(br.readLine()); } 
                catch (IOException e) { e.printStackTrace(); }
            }
            return st.nextToken();
        }
        public void close() throws IOException { br.close(); }
    }
} Main public static void main(String[] args) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Question q = new Question();
        q.main(in, out);
        out.close();
        in.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Question q = new Question();
        q.main(in, out);
        out.close();
        in.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out FastScanner in = new FastScanner(inputStream); in new FastScanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) Question q = new Question(); q new Question() q.main(in, out) q.main q in out out.close() out.close out in.close() in.close in String[] args args static class Question {
        int N;
        
        public int solve() {
            int i;
            for (i = 0; i < 7; i++) {
                if ( (1 << i) > N ) {
                    break;
                }
            }
            return 1 << (i-1);
        }
        
        public void main(FastScanner in, PrintWriter out) {
            N = in.nextInt();
            out.println( solve() );
        }
        
        public void p(Object o) { System.out.print(o); }
        public void pl(Object o) { System.out.println(o); }
        public void arp(int[] o) { pl( Arrays.toString(o) ); }
        public void arpp(int[][] o) { 
            for (int i = 0; i < o.length; i++) {
                for (int j = 0; j < o[0].length; j++) { p( o[i][j] + " " ); } pl("");
            }
        }
    } Question int N; N public int solve() {
            int i;
            for (i = 0; i < 7; i++) {
                if ( (1 << i) > N ) {
                    break;
                }
            }
            return 1 << (i-1);
        } solve {
            int i;
            for (i = 0; i < 7; i++) {
                if ( (1 << i) > N ) {
                    break;
                }
            }
            return 1 << (i-1);
        } int i; i for (i = 0; i < 7; i++) {
                if ( (1 << i) > N ) {
                    break;
                }
            } i = 0; i = 0 i 0 i < 7 i 7 i++ i++ i {
                if ( (1 << i) > N ) {
                    break;
                }
            } {
                if ( (1 << i) > N ) {
                    break;
                }
            } if ( (1 << i) > N ) {
                    break;
                } (1 << i) > N (1 << i) 1 i N {
                    break;
                } break; return 1 << (i-1); 1 << (i-1) 1 (i-1) i 1 public void main(FastScanner in, PrintWriter out) {
            N = in.nextInt();
            out.println( solve() );
        } main {
            N = in.nextInt();
            out.println( solve() );
        } N = in.nextInt() N in.nextInt() in.nextInt in out.println( solve() ) out.println out solve() solve FastScanner in in PrintWriter out out public void p(Object o) { System.out.print(o); } p { System.out.print(o); } System.out.print(o) System.out.print System.out System System.out o Object o o public void pl(Object o) { System.out.println(o); } pl { System.out.println(o); } System.out.println(o) System.out.println System.out System System.out o Object o o public void arp(int[] o) { pl( Arrays.toString(o) ); } arp { pl( Arrays.toString(o) ); } pl( Arrays.toString(o) ) pl Arrays.toString(o) Arrays.toString Arrays o int[] o o public void arpp(int[][] o) { 
            for (int i = 0; i < o.length; i++) {
                for (int j = 0; j < o[0].length; j++) { p( o[i][j] + " " ); } pl("");
            }
        } arpp { 
            for (int i = 0; i < o.length; i++) {
                for (int j = 0; j < o[0].length; j++) { p( o[i][j] + " " ); } pl("");
            }
        } for (int i = 0; i < o.length; i++) {
                for (int j = 0; j < o[0].length; j++) { p( o[i][j] + " " ); } pl("");
            } int i = 0; int i = 0; i 0 i < o.length i o.length o o.length i++ i++ i {
                for (int j = 0; j < o[0].length; j++) { p( o[i][j] + " " ); } pl("");
            } {
                for (int j = 0; j < o[0].length; j++) { p( o[i][j] + " " ); } pl("");
            } for (int j = 0; j < o[0].length; j++) { p( o[i][j] + " " ); } int j = 0; int j = 0; j 0 j < o[0].length j o[0].length o[0] o 0 o[0].length j++ j++ j { p( o[i][j] + " " ); } { p( o[i][j] + " " ); } p( o[i][j] + " " ) p o[i][j] + " " o[i][j] o[i] o i j " " pl("") pl "" int[][] o o static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        public FastScanner(InputStream in) { br = new BufferedReader(new InputStreamReader(in)); }
        public int nextInt() { return Integer.parseInt(next()); }
        public long nextLong() { return Long.parseLong(next()); }
        public double nextDouble() { return Double.parseDouble(next()); }
        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try { st = new StringTokenizer(br.readLine()); } 
                catch (IOException e) { e.printStackTrace(); }
            }
            return st.nextToken();
        }
        public void close() throws IOException { br.close(); }
    } FastScanner BufferedReader br; br StringTokenizer st; st public FastScanner(InputStream in) { br = new BufferedReader(new InputStreamReader(in)); } FastScanner { br = new BufferedReader(new InputStreamReader(in)); } br = new BufferedReader(new InputStreamReader(in)) br new BufferedReader(new InputStreamReader(in)) InputStream in in public int nextInt() { return Integer.parseInt(next()); } nextInt { return Integer.parseInt(next()); } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public long nextLong() { return Long.parseLong(next()); } nextLong { return Long.parseLong(next()); } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public double nextDouble() { return Double.parseDouble(next()); } nextDouble { return Double.parseDouble(next()); } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try { st = new StringTokenizer(br.readLine()); } 
                catch (IOException e) { e.printStackTrace(); }
            }
            return st.nextToken();
        } next {
            while (st == null || !st.hasMoreTokens()) {
                try { st = new StringTokenizer(br.readLine()); } 
                catch (IOException e) { e.printStackTrace(); }
            }
            return st.nextToken();
        } while (st == null || !st.hasMoreTokens()) {
                try { st = new StringTokenizer(br.readLine()); } 
                catch (IOException e) { e.printStackTrace(); }
            } st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens 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 public void close() throws IOException { br.close(); } close { br.close(); } br.close() br.close br public class Main {

    static class Question {
        int N;
        
        public int solve() {
            int i;
            for (i = 0; i < 7; i++) {
                if ( (1 << i) > N ) {
                    break;
                }
            }
            return 1 << (i-1);
        }
        
        public void main(FastScanner in, PrintWriter out) {
            N = in.nextInt();
            out.println( solve() );
        }
        
        public void p(Object o) { System.out.print(o); }
        public void pl(Object o) { System.out.println(o); }
        public void arp(int[] o) { pl( Arrays.toString(o) ); }
        public void arpp(int[][] o) { 
            for (int i = 0; i < o.length; i++) {
                for (int j = 0; j < o[0].length; j++) { p( o[i][j] + " " ); } pl("");
            }
        }
    }

    public static void main(String[] args) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Question q = new Question();
        q.main(in, out);
        out.close();
        in.close();
    }
    
    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        public FastScanner(InputStream in) { br = new BufferedReader(new InputStreamReader(in)); }
        public int nextInt() { return Integer.parseInt(next()); }
        public long nextLong() { return Long.parseLong(next()); }
        public double nextDouble() { return Double.parseDouble(next()); }
        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try { st = new StringTokenizer(br.readLine()); } 
                catch (IOException e) { e.printStackTrace(); }
            }
            return st.nextToken();
        }
        public void close() throws IOException { br.close(); }
    }
} public class Main {

    static class Question {
        int N;
        
        public int solve() {
            int i;
            for (i = 0; i < 7; i++) {
                if ( (1 << i) > N ) {
                    break;
                }
            }
            return 1 << (i-1);
        }
        
        public void main(FastScanner in, PrintWriter out) {
            N = in.nextInt();
            out.println( solve() );
        }
        
        public void p(Object o) { System.out.print(o); }
        public void pl(Object o) { System.out.println(o); }
        public void arp(int[] o) { pl( Arrays.toString(o) ); }
        public void arpp(int[][] o) { 
            for (int i = 0; i < o.length; i++) {
                for (int j = 0; j < o[0].length; j++) { p( o[i][j] + " " ); } pl("");
            }
        }
    }

    public static void main(String[] args) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Question q = new Question();
        q.main(in, out);
        out.close();
        in.close();
    }
    
    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        public FastScanner(InputStream in) { br = new BufferedReader(new InputStreamReader(in)); }
        public int nextInt() { return Integer.parseInt(next()); }
        public long nextLong() { return Long.parseLong(next()); }
        public double nextDouble() { return Double.parseDouble(next()); }
        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try { st = new StringTokenizer(br.readLine()); } 
                catch (IOException e) { e.printStackTrace(); }
            }
            return st.nextToken();
        }
        public void close() throws IOException { br.close(); }
    }
} Main
import java.io.*;
import java.util.*;

public class Main {

    static class Question {
        int N;
        
        public int solve() {
            int i;
            for (i = 0; i < 7; i++) {
                if ( (1 << i) > N ) {
                    break;
                }
            }
            return 1 << (i-1);
        }
        
        public void main(FastScanner in, PrintWriter out) {
            N = in.nextInt();
            out.println( solve() );
        }
        
        public void p(Object o) { System.out.print(o); }
        public void pl(Object o) { System.out.println(o); }
        public void arp(int[] o) { pl( Arrays.toString(o) ); }
        public void arpp(int[][] o) { 
            for (int i = 0; i < o.length; i++) {
                for (int j = 0; j < o[0].length; j++) { p( o[i][j] + " " ); } pl("");
            }
        }
    }

    public static void main(String[] args) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Question q = new Question();
        q.main(in, out);
        out.close();
        in.close();
    }
    
    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        public FastScanner(InputStream in) { br = new BufferedReader(new InputStreamReader(in)); }
        public int nextInt() { return Integer.parseInt(next()); }
        public long nextLong() { return Long.parseLong(next()); }
        public double nextDouble() { return Double.parseDouble(next()); }
        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try { st = new StringTokenizer(br.readLine()); } 
                catch (IOException e) { e.printStackTrace(); }
            }
            return st.nextToken();
        }
        public void close() throws IOException { br.close(); }
    }
}