import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans = 0;
        boolean check = true;
        if (N >= 2) {
            while (N > 0) {
                ans++;
                N = N / 2;
            }
        } else {
            check = false;
        }
        if (check == false) {
            System.out.println(N);
        } else {
            System.out.println((int)Math.pow(2,(ans - 1)));
        }
    }

} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans = 0;
        boolean check = true;
        if (N >= 2) {
            while (N > 0) {
                ans++;
                N = N / 2;
            }
        } else {
            check = false;
        }
        if (check == false) {
            System.out.println(N);
        } else {
            System.out.println((int)Math.pow(2,(ans - 1)));
        }
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans = 0;
        boolean check = true;
        if (N >= 2) {
            while (N > 0) {
                ans++;
                N = N / 2;
            }
        } else {
            check = false;
        }
        if (check == false) {
            System.out.println(N);
        } else {
            System.out.println((int)Math.pow(2,(ans - 1)));
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans = 0;
        boolean check = true;
        if (N >= 2) {
            while (N > 0) {
                ans++;
                N = N / 2;
            }
        } else {
            check = false;
        }
        if (check == false) {
            System.out.println(N);
        } else {
            System.out.println((int)Math.pow(2,(ans - 1)));
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int ans = 0; ans 0 boolean check = true; check true if (N >= 2) {
            while (N > 0) {
                ans++;
                N = N / 2;
            }
        } else {
            check = false;
        } N >= 2 N 2 {
            while (N > 0) {
                ans++;
                N = N / 2;
            }
        } while (N > 0) {
                ans++;
                N = N / 2;
            } N > 0 N 0 {
                ans++;
                N = N / 2;
            } ans++ ans N = N / 2 N N / 2 N 2 {
            check = false;
        } check = false check false if (check == false) {
            System.out.println(N);
        } else {
            System.out.println((int)Math.pow(2,(ans - 1)));
        } check == false check false {
            System.out.println(N);
        } System.out.println(N) System.out.println System.out System System.out N {
            System.out.println((int)Math.pow(2,(ans - 1)));
        } System.out.println((int)Math.pow(2,(ans - 1))) System.out.println System.out System System.out (int)Math.pow(2,(ans - 1)) Math.pow Math 2 (ans - 1) ans 1 String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans = 0;
        boolean check = true;
        if (N >= 2) {
            while (N > 0) {
                ans++;
                N = N / 2;
            }
        } else {
            check = false;
        }
        if (check == false) {
            System.out.println(N);
        } else {
            System.out.println((int)Math.pow(2,(ans - 1)));
        }
    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans = 0;
        boolean check = true;
        if (N >= 2) {
            while (N > 0) {
                ans++;
                N = N / 2;
            }
        } else {
            check = false;
        }
        if (check == false) {
            System.out.println(N);
        } else {
            System.out.println((int)Math.pow(2,(ans - 1)));
        }
    }

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans = 0;
        boolean check = true;
        if (N >= 2) {
            while (N > 0) {
                ans++;
                N = N / 2;
            }
        } else {
            check = false;
        }
        if (check == false) {
            System.out.println(N);
        } else {
            System.out.println((int)Math.pow(2,(ans - 1)));
        }
    }

}