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
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.math.BigInteger;
import java.util.Scanner;


/**
 *
 * @author B2lawa
 */
public class Main {

    static int []prims= {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59};
    static BigInteger  OO = new BigInteger("1000000000000000010");
    static BigInteger memo[][] = new BigInteger[17][1001];
    static int N = 17;
    static BigInteger DP(int idx , int rem)
    {
    if(rem==1)
        return BigInteger.ONE;
    if(idx==N)
        return OO;
        if (memo[idx][rem] != null) return memo[idx][rem];
    BigInteger c2= OO;
    BigInteger cur= BigInteger.ONE;
    int p = 1;
    while(p<=rem && cur.compareTo(OO)==-1)
    {
        if(rem % p == 0)
        {
            BigInteger x = DP(idx+1,rem/p);
                        x= x.multiply(cur);
                        if(x.compareTo(c2)==-1)
                            c2=x;
        }
        cur=cur.multiply((BigInteger.valueOf(prims[idx])));
        p++;
    }
    return memo[idx][rem]=c2;
}

    public static void main(String[] args) {
       
    Scanner in = new Scanner(System.in);
        int NN=in.nextInt();
            //NN*=2;
            BigInteger r1= DP(0,NN);
            //BigInteger r2= DP(0,NN-1);
            //if(r1.compareTo(r2)==-1)
             //   r2=r1;
            System.out.println(r1);
    }

}
