import static java.math.BigInteger.valueOf;

import java.util.Arrays;

public class GenBadTest {

	static int[] p;
	static int[] d;
	static long ans;
	static long best;

	static void solve(long x) throws Exception {
		MAXN = x;
		p = new int[50];
		p[0] = 2;
		d = new int[p.length];
		for (int i = 1; i < p.length; i++) {
			p[i] = valueOf(p[i - 1]).nextProbablePrime().intValue();
		}
		go(0, 1, 1, 30);
		System.err.println(best + " " + ans);
	}

	static long MAXN = 1000000000L;

	static void go(int x, long n, long div, int maxPow) {
		if (ans < div) {
			ans = div;
			best = n;
		}
		if (x == p.length) {
			return;
		}
		long pow = 1;
		for (int i = 1; i <= maxPow; i++) {
			pow *= p[x];
			if (pow * n > MAXN) {
				break;
			}
			d[x] = i;
			go(x + 1, n * pow, div * (i + 1), i);
			d[x] = 0;
		}
	}

	public static void main(String[] args) throws Exception {
		try {
			solve(Long.parseLong(args[0]));
		} catch (Throwable e) {
			System.err.println("Integer expected");
		}
	}
}
