import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    }

    public static void solve(Scanner sc) {
        int n = sc.nextInt();
        int ans = 1;
        for (int i = 0; i <= 100; i++) {
            if (ans > n) {
                System.out.println(ans / 2);
                return;
            }
            ans *= 2;
        }
    }
} import java.util.Arrays; Arrays java.util import java.util.Comparator; Comparator java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    }

    public static void solve(Scanner sc) {
        int n = sc.nextInt();
        int ans = 1;
        for (int i = 0; i <= 100; i++) {
            if (ans > n) {
                System.out.println(ans / 2);
                return;
            }
            ans *= 2;
        }
    }
} Main public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    } main {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    } try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        } {
            solve(sc);
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) solve(sc) solve sc String[] args args public static void solve(Scanner sc) {
        int n = sc.nextInt();
        int ans = 1;
        for (int i = 0; i <= 100; i++) {
            if (ans > n) {
                System.out.println(ans / 2);
                return;
            }
            ans *= 2;
        }
    } solve {
        int n = sc.nextInt();
        int ans = 1;
        for (int i = 0; i <= 100; i++) {
            if (ans > n) {
                System.out.println(ans / 2);
                return;
            }
            ans *= 2;
        }
    } int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int ans = 1; ans 1 for (int i = 0; i <= 100; i++) {
            if (ans > n) {
                System.out.println(ans / 2);
                return;
            }
            ans *= 2;
        } int i = 0; int i = 0; i 0 i <= 100 i 100 i++ i++ i {
            if (ans > n) {
                System.out.println(ans / 2);
                return;
            }
            ans *= 2;
        } {
            if (ans > n) {
                System.out.println(ans / 2);
                return;
            }
            ans *= 2;
        } if (ans > n) {
                System.out.println(ans / 2);
                return;
            } ans > n ans n {
                System.out.println(ans / 2);
                return;
            } System.out.println(ans / 2) System.out.println System.out System System.out ans / 2 ans 2 return; ans *= 2 ans 2 Scanner sc sc public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    }

    public static void solve(Scanner sc) {
        int n = sc.nextInt();
        int ans = 1;
        for (int i = 0; i <= 100; i++) {
            if (ans > n) {
                System.out.println(ans / 2);
                return;
            }
            ans *= 2;
        }
    }
} public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    }

    public static void solve(Scanner sc) {
        int n = sc.nextInt();
        int ans = 1;
        for (int i = 0; i <= 100; i++) {
            if (ans > n) {
                System.out.println(ans / 2);
                return;
            }
            ans *= 2;
        }
    }
} Main
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    }

    public static void solve(Scanner sc) {
        int n = sc.nextInt();
        int ans = 1;
        for (int i = 0; i <= 100; i++) {
            if (ans > n) {
                System.out.println(ans / 2);
                return;
            }
            ans *= 2;
        }
    }
}