F. Factorial Prime
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Given an integer $$$x$$$, find the largest integer $$$y \leq x$$$ such that $$$y$$$ is a prime and can be written as a factorial, if such a $$$y$$$ does not exist print $$$-1$$$.

An integer $$$y$$$ can be written as a factorial if there exists an integer $$$z$$$ such that $$$1 \cdot 2 \cdot \ldots \cdot (z-1) \cdot z = y$$$.

Input

The only line of input contains the integer $$$x$$$ $$$(1 \leq x \leq 10^5)$$$.

Output

Print the largest integer $$$y \leq x$$$ such that $$$y$$$ is a prime and can be written as a factorial, if such a $$$y$$$ does not exist print out $$$-1$$$.

Examples
Input
1
Output
-1
Input
2
Output
2