import java.util.Scanner;

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

        while (Math.pow(2,n + 1) <= N ) {
          n = n + 1;
          
        } 
          System.out.println(Math.round(Math.pow(2,n)));
           
    }
}
 import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
      	int n = 0;

        while (Math.pow(2,n + 1) <= N ) {
          n = n + 1;
          
        } 
          System.out.println(Math.round(Math.pow(2,n)));
           
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
      	int n = 0;

        while (Math.pow(2,n + 1) <= N ) {
          n = n + 1;
          
        } 
          System.out.println(Math.round(Math.pow(2,n)));
           
    } main {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
      	int n = 0;

        while (Math.pow(2,n + 1) <= N ) {
          n = n + 1;
          
        } 
          System.out.println(Math.round(Math.pow(2,n)));
           
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int n = 0; n 0 while (Math.pow(2,n + 1) <= N ) {
          n = n + 1;
          
        } Math.pow(2,n + 1) <= N Math.pow(2,n + 1) Math.pow Math 2 n + 1 n 1 N {
          n = n + 1;
          
        } n = n + 1 n n + 1 n 1 System.out.println(Math.round(Math.pow(2,n))) System.out.println System.out System System.out Math.round(Math.pow(2,n)) Math.round Math Math.pow(2,n) Math.pow Math 2 n String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
      	int n = 0;

        while (Math.pow(2,n + 1) <= N ) {
          n = n + 1;
          
        } 
          System.out.println(Math.round(Math.pow(2,n)));
           
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
      	int n = 0;

        while (Math.pow(2,n + 1) <= N ) {
          n = n + 1;
          
        } 
          System.out.println(Math.round(Math.pow(2,n)));
           
    }
} Main
import java.util.Scanner;

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

        while (Math.pow(2,n + 1) <= N ) {
          n = n + 1;
          
        } 
          System.out.println(Math.round(Math.pow(2,n)));
           
    }
}

