Multiplication Problem
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
In a math lesson, Byteik learned how to multiply and started applying this operation to various numbers. For instance, he would split a number into its digits and calculate the product of these digits. He then became curious about finding the largest product of digits among natural numbers that do not exceed N. Your task is to help solve this problem.
Input
A single integer N (1 ≤ N ≤ 2·10^9
).
Output
The maximum product of digits among numbers that do not exceed N.
Examples
Input #1
Answer #1
Submissions 768
Acceptance rate 19%