Greatest Product#1237

Greatest Product

1 second
64 megabytes
Very easy

For every positive integer , define the function as the product of the digits in the decimal representation of . Given a positive integer , find the maximum value of for x \leq N.

Input

The input contains a single integer (1 \leq N \leq 2 \cdot 10^9).

Output

Print the maximum value of the function for 1 \leq x \leq N.

Examples

Example 1

Loading
Loading