import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int r = 2;
    while (r <= N) {
      r *= 2;
    }
    r /= 2;
    System.out.println(r);
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int r = 2;
    while (r <= N) {
      r *= 2;
    }
    r /= 2;
    System.out.println(r);
  }
} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int r = 2;
    while (r <= N) {
      r *= 2;
    }
    r /= 2;
    System.out.println(r);
  } main {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int r = 2;
    while (r <= N) {
      r *= 2;
    }
    r /= 2;
    System.out.println(r);
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int r = 2; r 2 while (r <= N) {
      r *= 2;
    } r <= N r N {
      r *= 2;
    } r *= 2 r 2 r /= 2 r 2 System.out.println(r) System.out.println System.out System System.out r String[] args args public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int r = 2;
    while (r <= N) {
      r *= 2;
    }
    r /= 2;
    System.out.println(r);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int r = 2;
    while (r <= N) {
      r *= 2;
    }
    r /= 2;
    System.out.println(r);
  }
} Main
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int r = 2;
    while (r <= N) {
      r *= 2;
    }
    r /= 2;
    System.out.println(r);
  }
}
