import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();

    sc.close();

    int sum = 0;
    int count = 0;

    while (sum <= N) {
      count++;
      sum = (int) Math.pow(2, count);
    }

    System.out.println((int) Math.pow(2, count - 1));

  }

} import java.util.*; util.* java public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();

    sc.close();

    int sum = 0;
    int count = 0;

    while (sum <= N) {
      count++;
      sum = (int) Math.pow(2, count);
    }

    System.out.println((int) Math.pow(2, count - 1));

  }

} Main public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();

    sc.close();

    int sum = 0;
    int count = 0;

    while (sum <= N) {
      count++;
      sum = (int) Math.pow(2, count);
    }

    System.out.println((int) Math.pow(2, count - 1));

  } main {

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();

    sc.close();

    int sum = 0;
    int count = 0;

    while (sum <= N) {
      count++;
      sum = (int) Math.pow(2, count);
    }

    System.out.println((int) Math.pow(2, count - 1));

  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc sc.close() sc.close sc int sum = 0; sum 0 int count = 0; count 0 while (sum <= N) {
      count++;
      sum = (int) Math.pow(2, count);
    } sum <= N sum N {
      count++;
      sum = (int) Math.pow(2, count);
    } count++ count sum = (int) Math.pow(2, count) sum (int) Math.pow(2, count) Math.pow Math 2 count System.out.println((int) Math.pow(2, count - 1)) System.out.println System.out System System.out (int) Math.pow(2, count - 1) Math.pow Math 2 count - 1 count 1 String[] args args public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();

    sc.close();

    int sum = 0;
    int count = 0;

    while (sum <= N) {
      count++;
      sum = (int) Math.pow(2, count);
    }

    System.out.println((int) Math.pow(2, count - 1));

  }

} public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();

    sc.close();

    int sum = 0;
    int count = 0;

    while (sum <= N) {
      count++;
      sum = (int) Math.pow(2, count);
    }

    System.out.println((int) Math.pow(2, count - 1));

  }

} Main
import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();

    sc.close();

    int sum = 0;
    int count = 0;

    while (sum <= N) {
      count++;
      sum = (int) Math.pow(2, count);
    }

    System.out.println((int) Math.pow(2, count - 1));

  }

}