#P10411. Minimum Value by Prime Factor Decomposition

    ID: 12421 Type: Default 1000ms 256MiB

Minimum Value by Prime Factor Decomposition

Minimum Value by Prime Factor Decomposition

Alice loves prime factorization. She is given a positive integer \(x\). In one operation, she can choose two distinct prime numbers \(p_1\) and \(p_2\) and two positive integers \(\alpha_1\) and \(\alpha_2\). If \(x\) is divisible by \(p_1^{\alpha_1}p_2^{\alpha_2}\), then she can replace \(x\) with \(\displaystyle \frac{x}{p_1^{\alpha_1}p_2^{\alpha_2}}\). Otherwise, the operation is invalid.

Your task is to determine the minimum possible value of \(x\) that can be obtained by performing a sequence of such operations (possibly zero operations).

Note: You may choose any valid \(p_1,p_2,\alpha_1,\alpha_2\) in each operation. In particular, if \(x\) has at least two distinct prime factors, you can remove all its prime factors in one operation. However, if \(x\) is a prime power (or \(x=1\)), no such operation can be performed.

inputFormat

The input consists of a single line containing one positive integer \(x\) (\(1 \le x \le 10^{12}\)).

outputFormat

Output the minimum possible value of \(x\) that can be achieved by the operations described above.

sample

1
1