import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Map.Entry;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if (n == 1) {
            System.out.println(1); // 1/2 = 0.5??
            System.exit(0);
        }

        Map<Integer, Integer> an = new HashMap<Integer, Integer>();
        for (int i = 1; i <= n; i++) {
            int j = i;
            int c = 0;
            while (j % 2 == 0) {
                c += 1;
                j /= 2;
            }
            an.put(i, c);
        }

        int ans = 0;
        int max = 0;
        for(Entry<Integer, Integer> e : an.entrySet()) {
            if (e.getValue() > max) {
                max = e.getValue();
                ans = e.getKey();
            }
        }
        System.out.println(ans);
    }

} import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util import java.util.Map.Entry; Entry java.util.Map public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if (n == 1) {
            System.out.println(1); // 1/2 = 0.5??
            System.exit(0);
        }

        Map<Integer, Integer> an = new HashMap<Integer, Integer>();
        for (int i = 1; i <= n; i++) {
            int j = i;
            int c = 0;
            while (j % 2 == 0) {
                c += 1;
                j /= 2;
            }
            an.put(i, c);
        }

        int ans = 0;
        int max = 0;
        for(Entry<Integer, Integer> e : an.entrySet()) {
            if (e.getValue() > max) {
                max = e.getValue();
                ans = e.getKey();
            }
        }
        System.out.println(ans);
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if (n == 1) {
            System.out.println(1); // 1/2 = 0.5??
            System.exit(0);
        }

        Map<Integer, Integer> an = new HashMap<Integer, Integer>();
        for (int i = 1; i <= n; i++) {
            int j = i;
            int c = 0;
            while (j % 2 == 0) {
                c += 1;
                j /= 2;
            }
            an.put(i, c);
        }

        int ans = 0;
        int max = 0;
        for(Entry<Integer, Integer> e : an.entrySet()) {
            if (e.getValue() > max) {
                max = e.getValue();
                ans = e.getKey();
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if (n == 1) {
            System.out.println(1); // 1/2 = 0.5??
            System.exit(0);
        }

        Map<Integer, Integer> an = new HashMap<Integer, Integer>();
        for (int i = 1; i <= n; i++) {
            int j = i;
            int c = 0;
            while (j % 2 == 0) {
                c += 1;
                j /= 2;
            }
            an.put(i, c);
        }

        int ans = 0;
        int max = 0;
        for(Entry<Integer, Integer> e : an.entrySet()) {
            if (e.getValue() > max) {
                max = e.getValue();
                ans = e.getKey();
            }
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc if (n == 1) {
            System.out.println(1); // 1/2 = 0.5??
            System.exit(0);
        } n == 1 n 1 {
            System.out.println(1); // 1/2 = 0.5??
            System.exit(0);
        } System.out.println(1) System.out.println System.out System System.out 1 System.exit(0) System.exit System 0 Map<Integer, Integer> an = new HashMap<Integer, Integer>(); an new HashMap<Integer, Integer>() for (int i = 1; i <= n; i++) {
            int j = i;
            int c = 0;
            while (j % 2 == 0) {
                c += 1;
                j /= 2;
            }
            an.put(i, c);
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            int j = i;
            int c = 0;
            while (j % 2 == 0) {
                c += 1;
                j /= 2;
            }
            an.put(i, c);
        } {
            int j = i;
            int c = 0;
            while (j % 2 == 0) {
                c += 1;
                j /= 2;
            }
            an.put(i, c);
        } int j = i; j i int c = 0; c 0 while (j % 2 == 0) {
                c += 1;
                j /= 2;
            } j % 2 == 0 j % 2 j 2 0 {
                c += 1;
                j /= 2;
            } c += 1 c 1 j /= 2 j 2 an.put(i, c) an.put an i c int ans = 0; ans 0 int max = 0; max 0 for(Entry<Integer, Integer> e : an.entrySet()) {
            if (e.getValue() > max) {
                max = e.getValue();
                ans = e.getKey();
            }
        } Entry<Integer, Integer> e an.entrySet() an.entrySet an {
            if (e.getValue() > max) {
                max = e.getValue();
                ans = e.getKey();
            }
        } {
            if (e.getValue() > max) {
                max = e.getValue();
                ans = e.getKey();
            }
        } if (e.getValue() > max) {
                max = e.getValue();
                ans = e.getKey();
            } e.getValue() > max e.getValue() e.getValue e max {
                max = e.getValue();
                ans = e.getKey();
            } max = e.getValue() max e.getValue() e.getValue e ans = e.getKey() ans e.getKey() e.getKey e 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) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if (n == 1) {
            System.out.println(1); // 1/2 = 0.5??
            System.exit(0);
        }

        Map<Integer, Integer> an = new HashMap<Integer, Integer>();
        for (int i = 1; i <= n; i++) {
            int j = i;
            int c = 0;
            while (j % 2 == 0) {
                c += 1;
                j /= 2;
            }
            an.put(i, c);
        }

        int ans = 0;
        int max = 0;
        for(Entry<Integer, Integer> e : an.entrySet()) {
            if (e.getValue() > max) {
                max = e.getValue();
                ans = e.getKey();
            }
        }
        System.out.println(ans);
    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if (n == 1) {
            System.out.println(1); // 1/2 = 0.5??
            System.exit(0);
        }

        Map<Integer, Integer> an = new HashMap<Integer, Integer>();
        for (int i = 1; i <= n; i++) {
            int j = i;
            int c = 0;
            while (j % 2 == 0) {
                c += 1;
                j /= 2;
            }
            an.put(i, c);
        }

        int ans = 0;
        int max = 0;
        for(Entry<Integer, Integer> e : an.entrySet()) {
            if (e.getValue() > max) {
                max = e.getValue();
                ans = e.getKey();
            }
        }
        System.out.println(ans);
    }

} Main
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Map.Entry;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if (n == 1) {
            System.out.println(1); // 1/2 = 0.5??
            System.exit(0);
        }

        Map<Integer, Integer> an = new HashMap<Integer, Integer>();
        for (int i = 1; i <= n; i++) {
            int j = i;
            int c = 0;
            while (j % 2 == 0) {
                c += 1;
                j /= 2;
            }
            an.put(i, c);
        }

        int ans = 0;
        int max = 0;
        for(Entry<Integer, Integer> e : an.entrySet()) {
            if (e.getValue() > max) {
                max = e.getValue();
                ans = e.getKey();
            }
        }
        System.out.println(ans);
    }

}