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.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

public class Main {
	
	public static void main(String[] arg) {
		FastScanner scan = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = scan.nextInt();
		int MAX = 1001;
		long MAXL = 1000000000000000000L;
		List<Integer> p = new ArrayList<Integer>();
		boolean[] primes = new boolean[MAX];
		for(int i = 2; i < MAX; i++) primes[i] = true;
		for(int i = 2; i < MAX; i++){
			if(primes[i] == false) continue;
			primes[i] = true;
			p.add(i);
			for(int j = 2; i * j < MAX; j++){
				primes[i*j] = false;
			}
		}
		int MAX2 = p.size();
		long[][] dp = new long[MAX2+1][n+1];
		for(int i = 0; i < MAX2+1; i++){
			for(int j = 0; j < n + 1; j++){
				dp[i][j] = MAXL;
			}
		}
		for(int i = MAX2-1; i >= 0; i--){
			for(int j = 1; j <= n; j++){
				if(j == 1){
					dp[i][j] = 1;
					continue;
				}
				for(int k = 2; k <= j; k++){
					if(j % k == 0){
						long next = (long)Math.pow(p.get(i), k - 1) * dp[i+1][j/k];
						if(next < 0) continue;
						dp[i][j] = Math.min(dp[i][j], next);
					}
				}
			}
		}
		out.println(dp[0][n]);
		out.close();
	}

	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		FastScanner(InputStream is) {
			try {
				br = new BufferedReader(new InputStreamReader(is));
			} catch (Exception e) {
				e.printStackTrace();
			}
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception e) {
					return null;
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.valueOf(next());
		}
	}
}
