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
/**
 * Created by IntelliJ IDEA.
 * User: Taras_Brzezinsky
 * Date: 9/13/11
 * Time: 5:33 PM
 * To change this template use File | Settings | File Templates.
 */

import com.sun.org.apache.bcel.internal.classfile.InnerClass;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.IOException;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;

public class TaskB extends Thread {
    public TaskB() {
        this.input = new BufferedReader(new InputStreamReader(System.in));
        this.output = new PrintWriter(System.out);
        this.setPriority(Thread.MAX_PRIORITY);
    }

    void go(int where, long n, int d, int prev) {
        if (d == wanted) {
            result = Math.min(result, n);
        } else {
            long now = n;
            for (int i = 1; i <= prev; ++i) {
                if (now > result / primes[where]) {
                    break;
                }
                now *= primes[where];
                if (wanted % (d*(i + 1)) == 0) {
                    go(where + 1, now, d * (i + 1), i);
                }
            }
        }
    }


    private void solve() throws Throwable {
        wanted = nextInt();
        go(0, 1, 1, 62);
        output.println(result);
    }
    static long result = Long.MAX_VALUE;
    static int wanted;
    public void run() {
        try {
            solve();
        } catch (Throwable e) {
            System.err.println(e.getMessage());
            e.printStackTrace();
            System.exit(666);
        } finally {
            output.flush();
            output.close();
        }
    }

    public static void main(String[] args) {
        new TaskB().start();
    }

    private int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    private long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    private double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    private String nextToken() throws IOException {
        while (tokens == null || !tokens.hasMoreTokens()) {
            tokens = new StringTokenizer(input.readLine());
        }
        return tokens.nextToken();
    }
    static int []primes = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37};
    private BufferedReader input;
    private PrintWriter output;
    private StringTokenizer tokens = null;
}
