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