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.lang.Math;
import java.util.*;

public class Main
{	
	public BufferedReader in;
	public PrintStream out;
	
	public boolean log_enabled = false;
	
	int[] primes = {2,3,5,7,11,13,17,19,23,29,31};
	
	long min;
	
	public long pow(long x, int k, long p)
	{
		int d = 1;		
		long r = 1;
		
		while (d<k) d<<=1;
		
		while (d>0)
		{
			if (r>1000000000)
			{
				return min;
			}
			
			logWrite(" %d < 1000000000\n", r);
			
			r*= r;
			
			if (r >= min)
			{
				return min;
			}
			
			if ((k&d)>0)
			{
				r *= x;
			}
			
			if (r >= min)
			{
				return min;
			}
			
			if (p > 1+ min/r)
			{
				return min;
			}
			
			d>>=1;
			
			logWrite(" * %d\n", r*p);
		}
		
		logWrite("*****\n");
		
		return p*r;
	}
	
	public void recurs(int n, int f, long p)
	{
		if (n==1)		
		{
			if (p<min)
			{
				min = p;
			}
		}
		
		if (p>=min)
		{
			return;
		}
	
		for (int i=2; i<=n; i++)
		{
			if (n  % i == 0)
			{
				recurs(n/i, f+1, pow(primes[f], i-1, p));
			}
		}
	}
	
	public void test()
	{
		int n = readInt();
		
		/*Arrays.fill(dividers, false);
		for (int i=2; i<=n; i++)
		{
			if (n % i) dividers[i] = true;
		}*/
		
		min = 1000000000;		
		min *= min;
		
		recurs(n, 0, 1);
		out.println(min);
	}
    
	public void run()
	{
		try
		{
			in = new BufferedReader(new InputStreamReader(System.in));
			out = System.out;
			
			//in = new BufferedReader(new FileReader("in.txt"));
			//out = new PrintStream(new File("out.txt"));
			
			
		}
		catch (Exception e)
		{
			return;
		}
		
		//while (true)
		{
			//int t = readInt(); for (int i=0; i<t; i++)					
			{
				test();
			}
		}
	}
	
	public static void main(String args[])
	{
		new Main().run();
	}
	
	private StringTokenizer tokenizer = null;
	
	public int readInt() 
	{
        return Integer.parseInt(readToken());
    }
   
    public long readLong() 
	{
        return Long.parseLong(readToken());
    }
   
    public double readDouble() 
	{
        return Double.parseDouble(readToken());
    }
   
	public String readLn()
	{	
		try
		{
			String s;
			while ((s = in.readLine()).length()==0);
			return s;
		}
		catch (Exception e)
		{
			return "";
		}
	}
	
    public String readToken() 
	{
		try
		{
			while (tokenizer == null || !tokenizer.hasMoreTokens()) 
			{
				tokenizer = new StringTokenizer(in.readLine());
			}
			return tokenizer.nextToken();
		}
		catch (Exception e)
		{
			return "";
		}
    }
	
	public int[] readIntArray(int n)
	{
		int[] x = new int[n];
		readIntArray(x, n);
		return x;
	}
	
	public void readIntArray(int[] x, int n)
	{
		for (int i=0; i<n; i++)
		{
			x[i] = readInt();
		}
	}
	
	public void logWrite(String format, Object... args)
	{
		if (!log_enabled)
		{
			return;
		}
		
		out.printf(format, args);
	}
}

