The largest prime number P1086 product

Title Description

We call an integer \ (x \) is the "prime product" if and only if \ (x = a \ times b \) and \ (a \) and \ (b \) is a prime number.
Now tell you a number \ (N (1 \ Le N \ Le 10 ^ 5) \) , please help find \ (1 \) to \ (N \) in the range of the largest prime number product.

Input Format

The input comprises a single line integer \ (N (. 1 \ Le N \ Le ^ 10. 5) \) .

Output Format

The maximum output that satisfies \ (\ le N \) value of the product of prime numbers; if there is no such number, outputs "-1."

Sample input

7

Sample Output

6

Guess you like

Origin www.cnblogs.com/problems/p/P1086.html