import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int num = 2;
    if (n==1){
      System.out.println(1);
    }else{
      while(num*2<=n){
        num = num*2;
      }
      System.out.println(num);
    }
  }
} 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 num = 2;
    if (n==1){
      System.out.println(1);
    }else{
      while(num*2<=n){
        num = num*2;
      }
      System.out.println(num);
    }
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int num = 2;
    if (n==1){
      System.out.println(1);
    }else{
      while(num*2<=n){
        num = num*2;
      }
      System.out.println(num);
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int num = 2;
    if (n==1){
      System.out.println(1);
    }else{
      while(num*2<=n){
        num = num*2;
      }
      System.out.println(num);
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int num = 2; num 2 if (n==1){
      System.out.println(1);
    }else{
      while(num*2<=n){
        num = num*2;
      }
      System.out.println(num);
    } n==1 n 1 {
      System.out.println(1);
    } System.out.println(1) System.out.println System.out System System.out 1 {
      while(num*2<=n){
        num = num*2;
      }
      System.out.println(num);
    } while(num*2<=n){
        num = num*2;
      } num*2<=n num*2 num 2 n {
        num = num*2;
      } num = num*2 num num*2 num 2 System.out.println(num) System.out.println System.out System System.out num String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int num = 2;
    if (n==1){
      System.out.println(1);
    }else{
      while(num*2<=n){
        num = num*2;
      }
      System.out.println(num);
    }
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int num = 2;
    if (n==1){
      System.out.println(1);
    }else{
      while(num*2<=n){
        num = num*2;
      }
      System.out.println(num);
    }
  }
} 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 num = 2;
    if (n==1){
      System.out.println(1);
    }else{
      while(num*2<=n){
        num = num*2;
      }
      System.out.println(num);
    }
  }
}