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
//package javaapplication1;
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
import sun.security.util.Length;
public class Main {
    public static List<Integer>FP=new ArrayList<>();
    public static void main(String[] args) throws IOException{
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw=new PrintWriter(new PrintStream(System.out));
        Scanner sc=new Scanner(System.in);
        long max=1000000000000000000L;
        int n=Integer.parseInt(br.readLine());
        long arr[][] = new long[n + 1][11];
        //fill all with the max value
        for (int i = 0; i <=n; ++i) 
             {Arrays.fill(arr[i], Long.MAX_VALUE);}
            arr[1][0]=1;
            //consider first 11 primes
            int array[] = new int[]{0,2,3,5,7,11,13,17,19,23,29};
            for(int i = 1;i <= n;i++){
		for(int j = 1;j <= 10;j++){
			long pow = 1;
			int cnt = 1;
			while(pow < max || pow < 0){
			if(i % cnt == 0 && arr[i/cnt][j - 1] <= max*1.0/pow)
			arr[i][j] = Math.min(arr[i][j],arr[i/cnt][j - 1]*pow);
			pow *= array[j];
			++cnt;
		}
		
	}
}
        
         System.out.println(arr[n][10]);
    }
    
}