Multiplication Problem#8663

Multiplication Problem

1 second
64 megabytes
Easy

In a math lesson, Baytik learned how to multiply and began applying this operation to various numbers. For instance, he split a number into its digits and calculated the product of these digits. Now he is interested in finding the largest product of digits among natural numbers that do not exceed . Help him solve this problem.

Input

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

Output

Print the maximum product of digits among all numbers not exceeding .

Examples

Example 1

Loading
Loading