You are given a large integer value n. Find the largest number x such that x≤n and all digits of x are prime.
Input:
Only line of input consists of a single integer denoting n.
Output:
Print the required answer.
Constraints:
1≤Numberofdigitsinn≤105
There will be no leading zeroes in n.
n≥2
777 is the largest number less than or equal to 1000 having all it's digits prime.