import java.util.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        int v = N;
        int ans = 1;
        int cnt = 0;
        while (v > 1) {
            v >>= 1;
            cnt++;
            ans *= 2;
        }

        System.out.println(ans);

        return;
    }

} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
} Main public static void main(String[] args) {
        new Solver().run();
    } main {
        new Solver().run();
    } new Solver().run() new Solver().run new Solver() String[] args args class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        int v = N;
        int ans = 1;
        int cnt = 0;
        while (v > 1) {
            v >>= 1;
            cnt++;
            ans *= 2;
        }

        System.out.println(ans);

        return;
    }

} Solver public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        int v = N;
        int ans = 1;
        int cnt = 0;
        while (v > 1) {
            v >>= 1;
            cnt++;
            ans *= 2;
        }

        System.out.println(ans);

        return;
    } run {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        int v = N;
        int ans = 1;
        int cnt = 0;
        while (v > 1) {
            v >>= 1;
            cnt++;
            ans *= 2;
        }

        System.out.println(ans);

        return;
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int v = N; v N int ans = 1; ans 1 int cnt = 0; cnt 0 while (v > 1) {
            v >>= 1;
            cnt++;
            ans *= 2;
        } v > 1 v 1 {
            v >>= 1;
            cnt++;
            ans *= 2;
        } v >>= 1 v 1 cnt++ cnt ans *= 2 ans 2 System.out.println(ans) System.out.println System.out System System.out ans return;
import java.util.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        int v = N;
        int ans = 1;
        int cnt = 0;
        while (v > 1) {
            v >>= 1;
            cnt++;
            ans *= 2;
        }

        System.out.println(ans);

        return;
    }

}