import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] count = new int[N];
        for(int i=1;i<=N;i++){
            int x = i;
            while(i != 0){
                if(x % 2 == 0){
                    count[i-1]++;
                    x = x / 2;
                }
                else{
                    break;
                }
            }
        }
        int max = count[0];
        int soeji = 0;
        for(int i = 1;i< N;i++){
            if(count[i] > max){
                max = count[i];
                soeji = i;
            }
        }
        System.out.println(soeji+1);
    }
} 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();
        int[] count = new int[N];
        for(int i=1;i<=N;i++){
            int x = i;
            while(i != 0){
                if(x % 2 == 0){
                    count[i-1]++;
                    x = x / 2;
                }
                else{
                    break;
                }
            }
        }
        int max = count[0];
        int soeji = 0;
        for(int i = 1;i< N;i++){
            if(count[i] > max){
                max = count[i];
                soeji = i;
            }
        }
        System.out.println(soeji+1);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] count = new int[N];
        for(int i=1;i<=N;i++){
            int x = i;
            while(i != 0){
                if(x % 2 == 0){
                    count[i-1]++;
                    x = x / 2;
                }
                else{
                    break;
                }
            }
        }
        int max = count[0];
        int soeji = 0;
        for(int i = 1;i< N;i++){
            if(count[i] > max){
                max = count[i];
                soeji = i;
            }
        }
        System.out.println(soeji+1);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] count = new int[N];
        for(int i=1;i<=N;i++){
            int x = i;
            while(i != 0){
                if(x % 2 == 0){
                    count[i-1]++;
                    x = x / 2;
                }
                else{
                    break;
                }
            }
        }
        int max = count[0];
        int soeji = 0;
        for(int i = 1;i< N;i++){
            if(count[i] > max){
                max = count[i];
                soeji = i;
            }
        }
        System.out.println(soeji+1);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int[] count = new int[N]; count new int[N] N for(int i=1;i<=N;i++){
            int x = i;
            while(i != 0){
                if(x % 2 == 0){
                    count[i-1]++;
                    x = x / 2;
                }
                else{
                    break;
                }
            }
        } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
            int x = i;
            while(i != 0){
                if(x % 2 == 0){
                    count[i-1]++;
                    x = x / 2;
                }
                else{
                    break;
                }
            }
        } {
            int x = i;
            while(i != 0){
                if(x % 2 == 0){
                    count[i-1]++;
                    x = x / 2;
                }
                else{
                    break;
                }
            }
        } int x = i; x i while(i != 0){
                if(x % 2 == 0){
                    count[i-1]++;
                    x = x / 2;
                }
                else{
                    break;
                }
            } i != 0 i 0 {
                if(x % 2 == 0){
                    count[i-1]++;
                    x = x / 2;
                }
                else{
                    break;
                }
            } if(x % 2 == 0){
                    count[i-1]++;
                    x = x / 2;
                }
                else{
                    break;
                } x % 2 == 0 x % 2 x 2 0 {
                    count[i-1]++;
                    x = x / 2;
                } count[i-1]++ count[i-1] count i-1 i 1 x = x / 2 x x / 2 x 2 {
                    break;
                } break; int max = count[0]; max count[0] count 0 int soeji = 0; soeji 0 for(int i = 1;i< N;i++){
            if(count[i] > max){
                max = count[i];
                soeji = i;
            }
        } int i = 1; int i = 1; i 1 i< N i N i++ i++ i {
            if(count[i] > max){
                max = count[i];
                soeji = i;
            }
        } {
            if(count[i] > max){
                max = count[i];
                soeji = i;
            }
        } if(count[i] > max){
                max = count[i];
                soeji = i;
            } count[i] > max count[i] count i max {
                max = count[i];
                soeji = i;
            } max = count[i] max count[i] count i soeji = i soeji i System.out.println(soeji+1) System.out.println System.out System System.out soeji+1 soeji 1 String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] count = new int[N];
        for(int i=1;i<=N;i++){
            int x = i;
            while(i != 0){
                if(x % 2 == 0){
                    count[i-1]++;
                    x = x / 2;
                }
                else{
                    break;
                }
            }
        }
        int max = count[0];
        int soeji = 0;
        for(int i = 1;i< N;i++){
            if(count[i] > max){
                max = count[i];
                soeji = i;
            }
        }
        System.out.println(soeji+1);
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] count = new int[N];
        for(int i=1;i<=N;i++){
            int x = i;
            while(i != 0){
                if(x % 2 == 0){
                    count[i-1]++;
                    x = x / 2;
                }
                else{
                    break;
                }
            }
        }
        int max = count[0];
        int soeji = 0;
        for(int i = 1;i< N;i++){
            if(count[i] > max){
                max = count[i];
                soeji = i;
            }
        }
        System.out.println(soeji+1);
    }
} Main
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] count = new int[N];
        for(int i=1;i<=N;i++){
            int x = i;
            while(i != 0){
                if(x % 2 == 0){
                    count[i-1]++;
                    x = x / 2;
                }
                else{
                    break;
                }
            }
        }
        int max = count[0];
        int soeji = 0;
        for(int i = 1;i< N;i++){
            if(count[i] > max){
                max = count[i];
                soeji = i;
            }
        }
        System.out.println(soeji+1);
    }
}
