import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        double ans = 1;
        for (int i=1; i<=n; i++) {
            double pwr = Math.pow(2, i);
            if (pwr > n) {
                System.out.println((int) ans);
                return;
            }
            ans = pwr;
        }
   }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        double ans = 1;
        for (int i=1; i<=n; i++) {
            double pwr = Math.pow(2, i);
            if (pwr > n) {
                System.out.println((int) ans);
                return;
            }
            ans = pwr;
        }
   }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        double ans = 1;
        for (int i=1; i<=n; i++) {
            double pwr = Math.pow(2, i);
            if (pwr > n) {
                System.out.println((int) ans);
                return;
            }
            ans = pwr;
        }
   } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        double ans = 1;
        for (int i=1; i<=n; i++) {
            double pwr = Math.pow(2, i);
            if (pwr > n) {
                System.out.println((int) ans);
                return;
            }
            ans = pwr;
        }
   } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc double ans = 1; ans 1 for (int i=1; i<=n; i++) {
            double pwr = Math.pow(2, i);
            if (pwr > n) {
                System.out.println((int) ans);
                return;
            }
            ans = pwr;
        } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
            double pwr = Math.pow(2, i);
            if (pwr > n) {
                System.out.println((int) ans);
                return;
            }
            ans = pwr;
        } {
            double pwr = Math.pow(2, i);
            if (pwr > n) {
                System.out.println((int) ans);
                return;
            }
            ans = pwr;
        } double pwr = Math.pow(2, i); pwr Math.pow(2, i) Math.pow Math 2 i if (pwr > n) {
                System.out.println((int) ans);
                return;
            } pwr > n pwr n {
                System.out.println((int) ans);
                return;
            } System.out.println((int) ans) System.out.println System.out System System.out (int) ans return; ans = pwr ans pwr String[] args args public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        double ans = 1;
        for (int i=1; i<=n; i++) {
            double pwr = Math.pow(2, i);
            if (pwr > n) {
                System.out.println((int) ans);
                return;
            }
            ans = pwr;
        }
   }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        double ans = 1;
        for (int i=1; i<=n; i++) {
            double pwr = Math.pow(2, i);
            if (pwr > n) {
                System.out.println((int) ans);
                return;
            }
            ans = pwr;
        }
   }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        double ans = 1;
        for (int i=1; i<=n; i++) {
            double pwr = Math.pow(2, i);
            if (pwr > n) {
                System.out.println((int) ans);
                return;
            }
            ans = pwr;
        }
   }
}
