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 10<sup class="upper-index">18</sup>.
The first line of the input contains integer *n* (1 ≤ *n* ≤ 1000).
# n = int(input())
# a = list(map(int, str(input()).split(' ')))
import math
import random


def get_dividers(n):
    cur_x = n
    dividers = []
    i = 2
    while cur_x > 1:
        if cur_x % i == 0:
            dividers += [i]
            cur_x /= i
        else:
            i += 1

    return dividers


def gen_primes(maxn):
    primes = []

    for i in range(2, maxn+1):
        if not any((i % p == 0) for p in primes):
            primes += [i]

    return primes


def main():
    n = int(input())

    primes = gen_primes(1000)
    # print(primes)
    dividers = get_dividers(n)
    # print(dividers)

    dividers = sorted(dividers, reverse=True)

    ans = 1
    for i, d in enumerate(dividers):
        ans *= math.pow(primes[i], d - 1)

    print(int(ans))


if __name__ == '__main__':
    main()
