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.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;


public class R027E {
    public void debug(Object... objects) { System.err.println(Arrays.deepToString(objects)); }
    
    List<Integer> primes;
    List<Integer> p;
    int n;
    double ans = 1e18;
    
    public R027E() {
        Scanner scanner = new Scanner(System.in);
        this.n = scanner.nextInt();
        this.primes = new ArrayList<Integer>();
        this.p = new ArrayList<Integer>();
    }
    
    boolean prime(int n) {
        for(int i=2; i<=Math.sqrt((double)n); i++) {
            if(n % i == 0) { return false; }
        }
        return true;
    }
    
    void f(int k) {
        if( k==1 ) {
            List<Integer> v = p;
            Collections.sort(v);
            Collections.reverse(v);
            double x = 1;
            for(int i=0; i<v.size(); i++) {
                for(int j=0; j<v.get(i); j++) {
                    x *= primes.get(i);
                    if(x > 1e18) { return; }
                }
            }
            if(x < ans) { ans = x; }
        } else {
            for(int i=2; i<=k; i++) {
                if(k % i == 0) { 
                    p.add(i-1);
                    f(k / i);
                    p.remove((int)(p.size()-1));
                }
            }
        }
    }
    
    private void process() {
        for(int i=2; i<1000; i++) {
            if(prime(i)) { primes.add(i); }
        }
        f(n);
        System.out.println((long)ans);
    }
    
    public static void main(String[] args) { new R027E().process(); }
}
