Greatest Product
September 10th is forester day. On this occasion Magic forest dwellers decided to make a party. Kuzma beaver is assigned to take care about intellectual games. Kuzma has invented at his opinion quite interesting game.
Rules of the game are simple. Master announces positive integer N. Player needs to calculate product of digits for each positive integer up to N and report the greatest product.
All answers should be known beforehand to allow interactive communication during a game. This causes problems since N could be relatively big (1 ≤ N ≤ 2000000000). Kuzma is not good using computers; he asks you to write a program which having positive integer N will find correct answer.
Input
Each line at input contains integer N.
Output
Corresponding line at output should contain greatest product for this N.