import java.util.Scanner;

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 (Math.pow(2, i) <= n) {
        continue;
      } else {
        System.out.println((int) Math.pow(2, i - 1));
        return;
      }
    }

  }
} import java.util.Scanner; Scanner 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 (Math.pow(2, i) <= n) {
        continue;
      } else {
        System.out.println((int) Math.pow(2, i - 1));
        return;
      }
    }

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

    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    for (int i = 0;; i++) {
      if (Math.pow(2, i) <= n) {
        continue;
      } else {
        System.out.println((int) Math.pow(2, i - 1));
        return;
      }
    }

  } main {

    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    for (int i = 0;; i++) {
      if (Math.pow(2, i) <= n) {
        continue;
      } else {
        System.out.println((int) Math.pow(2, i - 1));
        return;
      }
    }

  } 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 (Math.pow(2, i) <= n) {
        continue;
      } else {
        System.out.println((int) Math.pow(2, i - 1));
        return;
      }
    } int i = 0; int i = 0; i 0 i++ i++ i {
      if (Math.pow(2, i) <= n) {
        continue;
      } else {
        System.out.println((int) Math.pow(2, i - 1));
        return;
      }
    } {
      if (Math.pow(2, i) <= n) {
        continue;
      } else {
        System.out.println((int) Math.pow(2, i - 1));
        return;
      }
    } if (Math.pow(2, i) <= n) {
        continue;
      } else {
        System.out.println((int) Math.pow(2, i - 1));
        return;
      } Math.pow(2, i) <= n Math.pow(2, i) Math.pow Math 2 i n {
        continue;
      } continue; {
        System.out.println((int) Math.pow(2, i - 1));
        return;
      } 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 return; 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 (Math.pow(2, i) <= n) {
        continue;
      } else {
        System.out.println((int) Math.pow(2, i - 1));
        return;
      }
    }

  }
} 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 (Math.pow(2, i) <= n) {
        continue;
      } else {
        System.out.println((int) Math.pow(2, i - 1));
        return;
      }
    }

  }
} Main
import java.util.Scanner;

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 (Math.pow(2, i) <= n) {
        continue;
      } else {
        System.out.println((int) Math.pow(2, i - 1));
        return;
      }
    }

  }
}