import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author SimplyDivine
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            if (n < 2) {
                out.println(1);
            } else if (n < 4) {
                out.println(2);
            } else if (n < 8) {
                out.println(4);
            } else if (n < 16) {
                out.println(8);
            } else if (n < 32) {
                out.println(16);
            } else if (n < 64) {
                out.println(32);
            } else {
                out.println(64);
            }
        }

    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader(InputStream i) {
            br = new BufferedReader(new
                    InputStreamReader(i));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.StringTokenizer; StringTokenizer java.util import java.io.IOException; IOException java.io import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.InputStream; InputStream java.io public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            if (n < 2) {
                out.println(1);
            } else if (n < 4) {
                out.println(2);
            } else if (n < 8) {
                out.println(4);
            } else if (n < 16) {
                out.println(8);
            } else if (n < 32) {
                out.println(16);
            } else if (n < 64) {
                out.println(32);
            } else {
                out.println(64);
            }
        }

    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader(InputStream i) {
            br = new BufferedReader(new
                    InputStreamReader(i));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out FastReader in = new FastReader(inputStream); in new FastReader(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) TaskB solver = new TaskB(); solver new TaskB() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class TaskB {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            if (n < 2) {
                out.println(1);
            } else if (n < 4) {
                out.println(2);
            } else if (n < 8) {
                out.println(4);
            } else if (n < 16) {
                out.println(8);
            } else if (n < 32) {
                out.println(16);
            } else if (n < 64) {
                out.println(32);
            } else {
                out.println(64);
            }
        }

    } TaskB public void solve(int testNumber, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            if (n < 2) {
                out.println(1);
            } else if (n < 4) {
                out.println(2);
            } else if (n < 8) {
                out.println(4);
            } else if (n < 16) {
                out.println(8);
            } else if (n < 32) {
                out.println(16);
            } else if (n < 64) {
                out.println(32);
            } else {
                out.println(64);
            }
        } solve {
            int n = in.nextInt();
            if (n < 2) {
                out.println(1);
            } else if (n < 4) {
                out.println(2);
            } else if (n < 8) {
                out.println(4);
            } else if (n < 16) {
                out.println(8);
            } else if (n < 32) {
                out.println(16);
            } else if (n < 64) {
                out.println(32);
            } else {
                out.println(64);
            }
        } int n = in.nextInt(); n in.nextInt() in.nextInt in if (n < 2) {
                out.println(1);
            } else if (n < 4) {
                out.println(2);
            } else if (n < 8) {
                out.println(4);
            } else if (n < 16) {
                out.println(8);
            } else if (n < 32) {
                out.println(16);
            } else if (n < 64) {
                out.println(32);
            } else {
                out.println(64);
            } n < 2 n 2 {
                out.println(1);
            } out.println(1) out.println out 1 if (n < 4) {
                out.println(2);
            } else if (n < 8) {
                out.println(4);
            } else if (n < 16) {
                out.println(8);
            } else if (n < 32) {
                out.println(16);
            } else if (n < 64) {
                out.println(32);
            } else {
                out.println(64);
            } n < 4 n 4 {
                out.println(2);
            } out.println(2) out.println out 2 if (n < 8) {
                out.println(4);
            } else if (n < 16) {
                out.println(8);
            } else if (n < 32) {
                out.println(16);
            } else if (n < 64) {
                out.println(32);
            } else {
                out.println(64);
            } n < 8 n 8 {
                out.println(4);
            } out.println(4) out.println out 4 if (n < 16) {
                out.println(8);
            } else if (n < 32) {
                out.println(16);
            } else if (n < 64) {
                out.println(32);
            } else {
                out.println(64);
            } n < 16 n 16 {
                out.println(8);
            } out.println(8) out.println out 8 if (n < 32) {
                out.println(16);
            } else if (n < 64) {
                out.println(32);
            } else {
                out.println(64);
            } n < 32 n 32 {
                out.println(16);
            } out.println(16) out.println out 16 if (n < 64) {
                out.println(32);
            } else {
                out.println(64);
            } n < 64 n 64 {
                out.println(32);
            } out.println(32) out.println out 32 {
                out.println(64);
            } out.println(64) out.println out 64 int testNumber testNumber FastReader in in PrintWriter out out static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader(InputStream i) {
            br = new BufferedReader(new
                    InputStreamReader(i));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    } FastReader BufferedReader br; br StringTokenizer st; st public FastReader(InputStream i) {
            br = new BufferedReader(new
                    InputStreamReader(i));
        } FastReader {
            br = new BufferedReader(new
                    InputStreamReader(i));
        } br = new BufferedReader(new
                    InputStreamReader(i)) br new BufferedReader(new
                    InputStreamReader(i)) InputStream i i public 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 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 class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            if (n < 2) {
                out.println(1);
            } else if (n < 4) {
                out.println(2);
            } else if (n < 8) {
                out.println(4);
            } else if (n < 16) {
                out.println(8);
            } else if (n < 32) {
                out.println(16);
            } else if (n < 64) {
                out.println(32);
            } else {
                out.println(64);
            }
        }

    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader(InputStream i) {
            br = new BufferedReader(new
                    InputStreamReader(i));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            if (n < 2) {
                out.println(1);
            } else if (n < 4) {
                out.println(2);
            } else if (n < 8) {
                out.println(4);
            } else if (n < 16) {
                out.println(8);
            } else if (n < 32) {
                out.println(16);
            } else if (n < 64) {
                out.println(32);
            } else {
                out.println(64);
            }
        }

    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader(InputStream i) {
            br = new BufferedReader(new
                    InputStreamReader(i));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author SimplyDivine
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            if (n < 2) {
                out.println(1);
            } else if (n < 4) {
                out.println(2);
            } else if (n < 8) {
                out.println(4);
            } else if (n < 16) {
                out.println(8);
            } else if (n < 32) {
                out.println(16);
            } else if (n < 64) {
                out.println(32);
            } else {
                out.println(64);
            }
        }

    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader(InputStream i) {
            br = new BufferedReader(new
                    InputStreamReader(i));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

