import java.util.*;

public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    double max = 1;
    
    if(N == 1){
      max = 2;
    }else{
      for (int i = 0; i < N; i++){
        max = Math.pow(2, i);
        if (max > N){
          break;
        }
      }
    }
    max = max / 2;
    int answer = (int)max;
    
    System.out.println(answer);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    double max = 1;
    
    if(N == 1){
      max = 2;
    }else{
      for (int i = 0; i < N; i++){
        max = Math.pow(2, i);
        if (max > N){
          break;
        }
      }
    }
    max = max / 2;
    int answer = (int)max;
    
    System.out.println(answer);
  }
} Main public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    double max = 1;
    
    if(N == 1){
      max = 2;
    }else{
      for (int i = 0; i < N; i++){
        max = Math.pow(2, i);
        if (max > N){
          break;
        }
      }
    }
    max = max / 2;
    int answer = (int)max;
    
    System.out.println(answer);
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    double max = 1;
    
    if(N == 1){
      max = 2;
    }else{
      for (int i = 0; i < N; i++){
        max = Math.pow(2, i);
        if (max > N){
          break;
        }
      }
    }
    max = max / 2;
    int answer = (int)max;
    
    System.out.println(answer);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc double max = 1; max 1 if(N == 1){
      max = 2;
    }else{
      for (int i = 0; i < N; i++){
        max = Math.pow(2, i);
        if (max > N){
          break;
        }
      }
    } N == 1 N 1 {
      max = 2;
    } max = 2 max 2 {
      for (int i = 0; i < N; i++){
        max = Math.pow(2, i);
        if (max > N){
          break;
        }
      }
    } for (int i = 0; i < N; i++){
        max = Math.pow(2, i);
        if (max > N){
          break;
        }
      } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
        max = Math.pow(2, i);
        if (max > N){
          break;
        }
      } {
        max = Math.pow(2, i);
        if (max > N){
          break;
        }
      } max = Math.pow(2, i) max Math.pow(2, i) Math.pow Math 2 i if (max > N){
          break;
        } max > N max N {
          break;
        } break; max = max / 2 max max / 2 max 2 int answer = (int)max; answer (int)max System.out.println(answer) System.out.println System.out System System.out answer String args[] args public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    double max = 1;
    
    if(N == 1){
      max = 2;
    }else{
      for (int i = 0; i < N; i++){
        max = Math.pow(2, i);
        if (max > N){
          break;
        }
      }
    }
    max = max / 2;
    int answer = (int)max;
    
    System.out.println(answer);
  }
} public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    double max = 1;
    
    if(N == 1){
      max = 2;
    }else{
      for (int i = 0; i < N; i++){
        max = Math.pow(2, i);
        if (max > N){
          break;
        }
      }
    }
    max = max / 2;
    int answer = (int)max;
    
    System.out.println(answer);
  }
} Main
import java.util.*;

public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    double max = 1;
    
    if(N == 1){
      max = 2;
    }else{
      for (int i = 0; i < N; i++){
        max = Math.pow(2, i);
        if (max > N){
          break;
        }
      }
    }
    max = max / 2;
    int answer = (int)max;
    
    System.out.println(answer);
  }
}