import java.util.Scanner;

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");
            sc.close();
            return;
        }

        int max2 = 1;

        while (max2 < N) {
            max2 *= 2;
        }
        max2 /= 2;

        int count = 1;
        while (max2 <= N) {
            max2 *= count;
            count++;
        }
        max2 /= --count;

        System.out.println(max2);
        sc.close();
    }
} 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();

        if (N == 1) {
            System.out.println("1");
            sc.close();
            return;
        }

        int max2 = 1;

        while (max2 < N) {
            max2 *= 2;
        }
        max2 /= 2;

        int count = 1;
        while (max2 <= N) {
            max2 *= count;
            count++;
        }
        max2 /= --count;

        System.out.println(max2);
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();

        if (N == 1) {
            System.out.println("1");
            sc.close();
            return;
        }

        int max2 = 1;

        while (max2 < N) {
            max2 *= 2;
        }
        max2 /= 2;

        int count = 1;
        while (max2 <= N) {
            max2 *= count;
            count++;
        }
        max2 /= --count;

        System.out.println(max2);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();

        if (N == 1) {
            System.out.println("1");
            sc.close();
            return;
        }

        int max2 = 1;

        while (max2 < N) {
            max2 *= 2;
        }
        max2 /= 2;

        int count = 1;
        while (max2 <= N) {
            max2 *= count;
            count++;
        }
        max2 /= --count;

        System.out.println(max2);
        sc.close();
    } 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");
            sc.close();
            return;
        } N == 1 N 1 {
            System.out.println("1");
            sc.close();
            return;
        } System.out.println("1") System.out.println System.out System System.out "1" sc.close() sc.close sc return; int max2 = 1; max2 1 while (max2 < N) {
            max2 *= 2;
        } max2 < N max2 N {
            max2 *= 2;
        } max2 *= 2 max2 2 max2 /= 2 max2 2 int count = 1; count 1 while (max2 <= N) {
            max2 *= count;
            count++;
        } max2 <= N max2 N {
            max2 *= count;
            count++;
        } max2 *= count max2 count count++ count max2 /= --count max2 --count count System.out.println(max2) System.out.println System.out System System.out max2 sc.close() sc.close sc 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");
            sc.close();
            return;
        }

        int max2 = 1;

        while (max2 < N) {
            max2 *= 2;
        }
        max2 /= 2;

        int count = 1;
        while (max2 <= N) {
            max2 *= count;
            count++;
        }
        max2 /= --count;

        System.out.println(max2);
        sc.close();
    }
} 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");
            sc.close();
            return;
        }

        int max2 = 1;

        while (max2 < N) {
            max2 *= 2;
        }
        max2 /= 2;

        int count = 1;
        while (max2 <= N) {
            max2 *= count;
            count++;
        }
        max2 /= --count;

        System.out.println(max2);
        sc.close();
    }
} Main
import java.util.Scanner;

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");
            sc.close();
            return;
        }

        int max2 = 1;

        while (max2 < N) {
            max2 *= 2;
        }
        max2 /= 2;

        int count = 1;
        while (max2 <= N) {
            max2 *= count;
            count++;
        }
        max2 /= --count;

        System.out.println(max2);
        sc.close();
    }
}