import java.util.*;

class Main{

  static int answer(int n){
    int power = 1;
    for(int i=0;i<7;i++){
      if(power <= n && n < power*2){
        return power;
      }else{
        power = power*2;
      }
    }
    return 0;
  }

  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    System.out.println(answer(n));
  }
} import java.util.*; util.* java class Main{

  static int answer(int n){
    int power = 1;
    for(int i=0;i<7;i++){
      if(power <= n && n < power*2){
        return power;
      }else{
        power = power*2;
      }
    }
    return 0;
  }

  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    System.out.println(answer(n));
  }
} Main static int answer(int n){
    int power = 1;
    for(int i=0;i<7;i++){
      if(power <= n && n < power*2){
        return power;
      }else{
        power = power*2;
      }
    }
    return 0;
  } answer {
    int power = 1;
    for(int i=0;i<7;i++){
      if(power <= n && n < power*2){
        return power;
      }else{
        power = power*2;
      }
    }
    return 0;
  } int power = 1; power 1 for(int i=0;i<7;i++){
      if(power <= n && n < power*2){
        return power;
      }else{
        power = power*2;
      }
    } int i=0; int i=0; i 0 i<7 i 7 i++ i++ i {
      if(power <= n && n < power*2){
        return power;
      }else{
        power = power*2;
      }
    } {
      if(power <= n && n < power*2){
        return power;
      }else{
        power = power*2;
      }
    } if(power <= n && n < power*2){
        return power;
      }else{
        power = power*2;
      } power <= n && n < power*2 power <= n power n n < power*2 n power*2 power 2 {
        return power;
      } return power; power {
        power = power*2;
      } power = power*2 power power*2 power 2 return 0; 0 int n n public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    System.out.println(answer(n));
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    System.out.println(answer(n));
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc System.out.println(answer(n)) System.out.println System.out System System.out answer(n) answer n String args[] args
import java.util.*;

class Main{

  static int answer(int n){
    int power = 1;
    for(int i=0;i<7;i++){
      if(power <= n && n < power*2){
        return power;
      }else{
        power = power*2;
      }
    }
    return 0;
  }

  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    System.out.println(answer(n));
  }
}