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.*;
public class Myon
{
    public static void main(String args[]) throws Exception
    {
    	new Myon();
    }
    
    long res = (long) 1e18;
    
    boolean[] check;
    
    Myon(){
    	Scanner cin = new Scanner(System.in);
        long nokori = cin.nextLong();
        check = new boolean[20000];
        int i,j;
        for(i=0;i<20000;i++) check[i] = false;
        check[0] = check[1] = true;
        for(i=2;i<20000;i++){
        	if(!check[i]){
        		for(j=i*2;j<2000;j+=i){
        			check[j] = true;
        		}
        	}
        }
        saiki(nokori,1,2);
        System.out.println(res);
    }
    
    void saiki(long nokori, long now, long next){
    	if(now==-1) return;
    	if(check[(int)next]){ saiki(nokori,now,next+1); return;}
    	if(nokori==1){res = Math.min(res, now); return;}
    	saiki(1,getres(nokori,now,next),next+1);
    	int i;
    	for(i=(int)nokori;i>=2;i--){
    		if(nokori%i==0){
    			saiki(nokori/i,getres(i,now,next),next+1);
    		}
    	}
    }
    
    long getres(long nokori,long now,long next){
    	int i;
    	long r = now;
    	for(i=0;i<nokori-1;i++){
    		if(r*(double)next>(long)1e18) break;
    		r *= next;
    	}
    	if(i!=nokori-1) return -1;
    	return r;
    }
}