A natural number is called a derivative of a natural number if either coincides with or can be obtained by deleting some digits from the decimal representation of . For example, the derivatives of the number are , , , , , , , , , , and .
Given a natural number , determine the largest prime number which is a derivative of . If none of the derivatives of is prime, take P = 0. A natural number is called prime if P \neq 1 and has no divisors other than and .
The only line of input contains the number (0 < N < 10^9).
The program should output the number .
Example 1