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.math.BigInteger;
import java.util.*;

public class Main {
    public static int arr[] ;
    public static BigInteger sv[][] ;
    public static BigInteger dp(int n,int i){
        if(n == 1)
            return BigInteger.ONE ;
        if(i > 10)
            return new BigInteger("10000000000000000000") ;
        if(!sv[n][i].equals(BigInteger.valueOf(-1)))
            return sv[n][i] ;
        BigInteger r = dp(n,i+1) ;
        for(int j = 1 ; j < 70 ; j++){
            if(n < (j+1))
                break ;
            if(n%(j+1) == 0){
                BigInteger t = dp(n/(j+1),i+1).multiply( BigInteger.valueOf(arr[i]).pow(j));
                if(t.compareTo(r) < 0)
                    r = t ;
            }
        }
        return sv[n][i] = r ;
    }
    public static void main(String[] args) throws Exception {
        arr = new int[11] ;
        int ind =  0 ;
        for (int i = 2; i < 111; i++) {
            if(ind == 11)break ;
            boolean b = true ;
            for(int j = 2 ; j < i ; j++)
            {
                if(i%j == 0){
                    b = false ;
                    break ;
                }
            }
            if(b)
                arr[ind++] = i ;
        }
        int n ;
        Scanner cin = new Scanner(System.in);
        n = cin.nextInt() ;
        sv = new BigInteger[1111][12] ;
        for(int i = 0 ; i < 1111 ; i++)
            for(int j = 0 ; j < 12 ; j++)
                sv[i][j] = new BigInteger("-1");
        System.out.println(dp(n,0));
    }
}
