Given the number n, find the smallest positive integer which has exactly n divisors. It is guaranteed that for the given n the answer will not exceed 1018.

Input

The first line of the input contains integer n (1 ≤ n ≤ 1000).

Output

Output the smallest positive integer with exactly n divisors.

Examples

Input

4


Output

6


Input

6


Output

12
import java.io.*;
import java.util.*;
import java.lang.*;

public class TaskE {

	final int p[] = {2,3,5,7,11,13,17,19,23,29};
	final long inf = Long.MAX_VALUE;
	long[][] dp;

	long solve(int x,int rem) {
		if (dp[x][rem] > 0)
			return dp[x][rem];

		if (rem == 1)
			return dp[x][rem] = 1l;

		long mn = inf, mul = p[x];

		for (int i = 1; i < rem; i++, mul *= p[x]) {
			if (rem % (i+1) == 0) {
				double up = Math.log(1000000000000000000.0 / solve(x+1, rem/(i+1))) / Math.log(p[x]);
				if (i <= up) {
					mn = Math.min(mn, solve(x+1, rem/(i+1)) * mul);	
				}
			}
		}

		return dp[x][rem] = mn;
	}

	public TaskE() {
		Scanner in = new Scanner(System.in);

		int n = in.nextInt();

		dp = new long[12][n+5];
		
		System.out.println( solve(0, n) );
	}

	public static void main(String args[]) {
		
		new TaskE();

	}

}
