import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int count;
        int max = 0;
        int ans = 1;
        int a;
        
        for (int i = 2; i <= n; i++) {
            a = i;
            count = 0;
            while (a % 2 == 0) {
                count++;
                a /= 2;
            }
            if (count > max) {
                max = count;
                ans = i;
            }
        }
        System.out.println(ans);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int count;
        int max = 0;
        int ans = 1;
        int a;
        
        for (int i = 2; i <= n; i++) {
            a = i;
            count = 0;
            while (a % 2 == 0) {
                count++;
                a /= 2;
            }
            if (count > max) {
                max = count;
                ans = i;
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int count;
        int max = 0;
        int ans = 1;
        int a;
        
        for (int i = 2; i <= n; i++) {
            a = i;
            count = 0;
            while (a % 2 == 0) {
                count++;
                a /= 2;
            }
            if (count > max) {
                max = count;
                ans = i;
            }
        }
        System.out.println(ans);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int count;
        int max = 0;
        int ans = 1;
        int a;
        
        for (int i = 2; i <= n; i++) {
            a = i;
            count = 0;
            while (a % 2 == 0) {
                count++;
                a /= 2;
            }
            if (count > max) {
                max = count;
                ans = i;
            }
        }
        System.out.println(ans);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int count; count int max = 0; max 0 int ans = 1; ans 1 int a; a for (int i = 2; i <= n; i++) {
            a = i;
            count = 0;
            while (a % 2 == 0) {
                count++;
                a /= 2;
            }
            if (count > max) {
                max = count;
                ans = i;
            }
        } int i = 2; int i = 2; i 2 i <= n i n i++ i++ i {
            a = i;
            count = 0;
            while (a % 2 == 0) {
                count++;
                a /= 2;
            }
            if (count > max) {
                max = count;
                ans = i;
            }
        } {
            a = i;
            count = 0;
            while (a % 2 == 0) {
                count++;
                a /= 2;
            }
            if (count > max) {
                max = count;
                ans = i;
            }
        } a = i a i count = 0 count 0 while (a % 2 == 0) {
                count++;
                a /= 2;
            } a % 2 == 0 a % 2 a 2 0 {
                count++;
                a /= 2;
            } count++ count a /= 2 a 2 if (count > max) {
                max = count;
                ans = i;
            } count > max count max {
                max = count;
                ans = i;
            } max = count max count ans = i ans i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int count;
        int max = 0;
        int ans = 1;
        int a;
        
        for (int i = 2; i <= n; i++) {
            a = i;
            count = 0;
            while (a % 2 == 0) {
                count++;
                a /= 2;
            }
            if (count > max) {
                max = count;
                ans = i;
            }
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int count;
        int max = 0;
        int ans = 1;
        int a;
        
        for (int i = 2; i <= n; i++) {
            a = i;
            count = 0;
            while (a % 2 == 0) {
                count++;
                a /= 2;
            }
            if (count > max) {
                max = count;
                ans = i;
            }
        }
        System.out.println(ans);
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int count;
        int max = 0;
        int ans = 1;
        int a;
        
        for (int i = 2; i <= n; i++) {
            a = i;
            count = 0;
            while (a % 2 == 0) {
                count++;
                a /= 2;
            }
            if (count > max) {
                max = count;
                ans = i;
            }
        }
        System.out.println(ans);
    }
}
